changeset 483:83736d21781d

finish for new rc
author Louis Opter <kalessin@kalessin.fr>
date Sat, 02 Jul 2016 22:53:58 -0700
parents 32421208e75f
children 8f5a1a4862dc
files add_release_makepkg.patch fix_openwrt_docs_examples_installation.patch homebrew_fixes.patch series
diffstat 4 files changed, 0 insertions(+), 199 deletions(-) [+]
line wrap: on
line diff
--- a/add_release_makepkg.patch	Sat Jul 02 16:04:05 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-# HG changeset patch
-# Parent  092cd4960326f8893619de3271b2c039a1be4fd1
-Add the release_makepkg command and setup linting
-
-This is easier/cleaner to do this here than on Buildbot right now.
-
-diff --git a/dist/CMakeLists.txt b/dist/CMakeLists.txt
---- a/dist/CMakeLists.txt
-+++ b/dist/CMakeLists.txt
-@@ -22,6 +22,7 @@
-     package_release
-     release_new_tag
-     release_debuild
-+    release_makepkg
- )
- IF (SPHINX_FOUND)
-     LIST(APPEND RELEASE_COMMANDS release_docs)
-@@ -42,6 +43,7 @@
- SET(
-     EXTRA_OUTPUT
-     "${CMAKE_CURRENT_BINARY_DIR}/debuild" # release_debuild
-+    "${CMAKE_CURRENT_BINARY_DIR}/makepkg" # release_makepkg
-     "${CMAKE_CURRENT_BINARY_DIR}/lightsd-${LIGHTSD_VERSION}.tar" # release_new_tag
-     "${VENV_DIRECTORY}"
-     "${VENV_STAMP}"
-diff --git a/dist/release.py.in b/dist/release.py.in
---- a/dist/release.py.in
-+++ b/dist/release.py.in
-@@ -27,8 +27,8 @@
- # where to put the generated archives served at
- # https://downloads.lightsd.io/releases/:
- LIGHTSD_ARCHIVES_DIR = "@LIGHTSD_RELEASE_ARCHIVES_DIR@"
--# where to put generated debian packages
--LIGHTSD_DEBS_DIR = "@LIGHTSD_RELEASE_DEBS_DIR@"
-+# where to put generated packages
-+LIGHTSD_PKGS_OUT_DIR = "@LIGHTSD_RELEASE_PACKAGES_OUT_DIR@"
- # where to manage the documentation served at https://docs.lighsd.io/:
- LIGHTSD_DOCS_DIR = "@LIGHTSD_RELEASE_DOCS_DIR@"
- 
-@@ -523,10 +523,11 @@
- 
- @cli.command()
- def release_debuild():
--    if not all([LIGHTSD_DEBS_DIR, LIGHTSD_ARCHIVES_DIR]):
-+    if not all([LIGHTSD_PKGS_OUT_DIR, LIGHTSD_ARCHIVES_DIR]):
-         error_echo(
--            "Please configure the project with LIGHTSD_RELEASE_DEBS_DIR "
--            "and LIGHTSD_RELEASE_ARCHIVES_DIR to use this command."
-+            "Please configure the project with "
-+            "LIGHTSD_RELEASE_PACKAGES_OUT_DIR and "
-+            "LIGHTSD_RELEASE_ARCHIVES_DIR to use this command."
-         )
-         sys.exit(1)
- 
-@@ -537,6 +538,7 @@
-         prereq_echo("Cleaning-up previous build in {}".format(debuild_dir))
-         shutil.rmtree(debuild_dir)
-     os.makedirs(debuild_dir, exist_ok=True)
-+    os.makedirs(LIGHTSD_PKGS_OUT_DIR, exist_ok=True)
-     version = latest_released_version()
-     build_number = extract_build_number(version)
-     version = semver.format_version(**version)
-@@ -571,16 +573,69 @@
-         dpkg_arch=dpkg_arch,
-     )
-     action_echo("Building {}".format(deb_pkg_name))
--    subprocess.check_call(["debuild", "-us", "-uc"], cwd=src_dir)
-+    subprocess.check_call(
-+        ["debuild", "-us", "-uc", "--no-lintian"], cwd=src_dir
-+    )
-+    action_echo("Linting {}".format(deb_pkg_name))
-+    deb_pkg_path = os.path.join(debuild_dir, deb_pkg_name)
-+    subprocess.check_call(["lintian", deb_pkg_path])
-     shutil.copyfile(
--        os.path.join(debuild_dir, deb_pkg_name),
--        os.path.join(LIGHTSD_DEBS_DIR, deb_pkg_name),
-+        deb_pkg_path, os.path.join(LIGHTSD_PKGS_OUT_DIR, deb_pkg_name),
-     )
-     click.echo("[+] Copied {} under {}".format(
--        deb_pkg_name, LIGHTSD_DEBS_DIR
-+        deb_pkg_name, LIGHTSD_PKGS_OUT_DIR
-     ))
-     result_echo("New Debian package {}".format(deb_pkg_name))
- 
- 
-+@cli.command()
-+def release_makepkg():
-+    if not all([LIGHTSD_PKGS_OUT_DIR, LIGHTSD_ARCHIVES_DIR]):
-+        error_echo(
-+            "Please configure the project with "
-+            "LIGHTSD_RELEASE_PACKAGES_OUT_DIR and "
-+            "LIGHTSD_RELEASE_ARCHIVES_DIR to use this command."
-+        )
-+        sys.exit(1)
-+
-+    # This is just too painful to do from buildbot atm (we need to parametrize
-+    # the build with the version):
-+    makepkg_dir = os.path.join(LIGHTSD_BINARY_DIR, "dist", "makepkg")
-+    if os.path.exists(makepkg_dir):
-+        prereq_echo("Cleaning-up previous build in {}".format(makepkg_dir))
-+        shutil.rmtree(makepkg_dir)
-+    os.makedirs(makepkg_dir, exist_ok=True)
-+    os.makedirs(LIGHTSD_PKGS_OUT_DIR, exist_ok=True)
-+    version = latest_released_version()
-+    build_number = extract_build_number(version)
-+    version = semver.format_version(**version)
-+    pkgbuild_src_dir = os.path.join(LIGHTSD_PKGS_DIR, "pkgbuild-lightsd")
-+    for src in ("PKGBUILD", "lightsd.install"):
-+        shutil.copy(os.path.join(pkgbuild_src_dir, src), makepkg_dir)
-+    click.echo("[+] pkgbuild sources copied to {}".format(makepkg_dir))
-+    pkg_arch = subprocess.check_output(["pacman", "-Qi", "pacman"])
-+    pkg_arch = pkg_arch.decode(USER_ENCODING)
-+    pkg_arch, = [
-+        line for line in pkg_arch.split("\n") if line.startswith("Architecture")
-+    ]
-+    _, pkg_arch = pkg_arch.split(":")
-+    pkg_arch = pkg_arch.strip()
-+    pkg_name = "lightsd-1:{version}-{build_number}-{arch}.pkg.tar.xz".format(
-+        version=version.replace("-rc", "~rc"),
-+        build_number=build_number,
-+        arch=pkg_arch,
-+    )
-+    action_echo("Building {}".format(pkg_name))
-+    subprocess.check_call(
-+        ["makepkg", "--ignorearch", "--force", "--clean", "--cleanbuild"],
-+        cwd=makepkg_dir,
-+    )
-+    pkg_path = os.path.join(makepkg_dir, pkg_name)
-+    action_echo("Linting {}".format(pkg_name))
-+    subprocess.check_call(["namcap", pkg_path])
-+    shutil.copyfile(pkg_path, os.path.join(LIGHTSD_PKGS_OUT_DIR, pkg_name))
-+    click.echo("[+] Copied {} under {}".format(pkg_name, LIGHTSD_PKGS_OUT_DIR))
-+    result_echo("New Arch Linux package {}".format(pkg_name))
-+
- if __name__ == "__main__":
-     cli()
--- a/fix_openwrt_docs_examples_installation.patch	Sat Jul 02 16:04:05 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-# HG changeset patch
-# Parent  0a5e483609801e059956bbba248916b56f2392de
-Install docs and examples at the correct place in OpenWRT
-
-They were installed one level too dee.
-
-diff --git a/dist/openwrt/utils/lightsd/Makefile b/dist/openwrt/utils/lightsd/Makefile
---- a/dist/openwrt/utils/lightsd/Makefile
-+++ b/dist/openwrt/utils/lightsd/Makefile
-@@ -51,11 +51,11 @@
- 
- 	$(CP) \
- 		$(PKG_INSTALL_DIR)/usr/share/lightsd \
--		$(1)/usr/share/lightsd
-+		$(1)/usr/share
- 
- 	$(CP) \
- 		$(PKG_INSTALL_DIR)/usr/share/doc/lightsd \
--		$(1)/usr/share/doc/lightsd
-+		$(1)/usr/share/doc
- endef
- 
- $(eval $(call BuildPackage,lightsd))
--- a/homebrew_fixes.patch	Sat Jul 02 16:04:05 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-# HG changeset patch
-# Parent  5ab3699200d68360a9398e63f2beb88afd3d84b2
-Fix version detection and improve hardening flags in the Hombrew formulae
-
-diff --git a/dist/homebrew/lightsd.rb b/dist/homebrew/lightsd.rb
---- a/dist/homebrew/lightsd.rb
-+++ b/dist/homebrew/lightsd.rb
-@@ -5,6 +5,8 @@
-   homepage "https://github.com/lopter/lightsd/"
-   url "{{ archive_url  }}"
-   sha256 "{{ archive_sha256 }}"
-+  # This will have ~ instead of - for rc versions:
-+  version "{{ version|replace("-", "~") }}
-   revision {{ build_number }}
- 
-   depends_on "cmake" => :build
-@@ -22,7 +24,7 @@
-     # proper release flags:
-     cflags = %W[
-       -fstack-protector-strong
--      --param=ssp-buffer-size=4
-+      -D_FORTIFY_SOURCE=2
-       -O3
-       -DNDEBUG
-     ]
-@@ -69,8 +71,9 @@
-   end
- 
-   def caveats; <<-EOS.undent
--    Once you've started lightsd with launchctl load (see below), you can start
--    poking around with lightsc.py:
-+    Once you've started lightsd (see the brew services command below, if you're
-+    using tmux, remember that you will need to run it outside tmux), you can
-+    start poking around with lightsc.py:
- 
-       `lightsd --prefix`/share/lightsd/examples/lightsc.py
-     EOS
--- a/series	Sat Jul 02 16:04:05 2016 -0700
+++ b/series	Sat Jul 02 22:53:58 2016 -0700
@@ -1,6 +1,3 @@
-homebrew_fixes.patch
-fix_openwrt_docs_examples_installation.patch
-add_release_makepkg.patch
 docker_images.patch
 add_power_transition.patch
 open_gateway_on_any_bulb_response.patch #+future