From 8070b11c277b3187acc3036a0188dfde876f6108 Mon Sep 17 00:00:00 2001 From: Daniel Pavel Date: Mon, 7 Jan 2013 11:46:34 +0200 Subject: [PATCH] customized debian/ and debian packaging script to support ubuntu ppas --- packaging/build_deb.sh | 38 ++++++++++++++++++----------------- packaging/build_ppa.sh | 29 ++++++++++++++++++++++++++ packaging/debian/changelog | 8 +++++++- packaging/debian/control | 2 +- packaging/debian/rules | 13 ++++++------ packaging/debian/rules.extra | 1 + packaging/ubuntu/rules.extra | 9 +++++++++ packaging/ubuntu/solaar.links | 1 + packaging/upload_ppa.sh | 10 --------- 9 files changed, 74 insertions(+), 37 deletions(-) create mode 100755 packaging/build_ppa.sh create mode 100644 packaging/debian/rules.extra create mode 100644 packaging/ubuntu/rules.extra create mode 100644 packaging/ubuntu/solaar.links delete mode 100755 packaging/upload_ppa.sh diff --git a/packaging/build_deb.sh b/packaging/build_deb.sh index a3d0e3ef..9129c95a 100755 --- a/packaging/build_deb.sh +++ b/packaging/build_deb.sh @@ -1,15 +1,15 @@ #!/bin/sh -cd `dirname "$0"`/.. -mkdir -p dist -DIST="$PWD/dist" -DEBIAN="$PWD/packaging/debian" -RULES_D="$PWD/rules.d" +set -e -BUILD_DIR="${TMPDIR:-/tmp}/$PWD" +cd `dirname "$0"`/.. +DEBIAN_FILES="$PWD/packaging/debian" +DIST="$PWD/dist/${DISTRIBUTION:=debian}" + +BUILD_DIR="${TMPDIR:-/tmp}/$DIST" +rm -rf "$BUILD_DIR" mkdir -m 0700 -p "$BUILD_DIR" -rm -rf "$BUILD_DIR"/* -python setup.py sdist --dist-dir="$BUILD_DIR" +python "setup.py" sdist --dist-dir="$BUILD_DIR" --formats=gztar cd "$BUILD_DIR" S=`ls -1 solaar-*.tar.gz` @@ -18,13 +18,15 @@ VERSION=${VERSION%.tar.gz} tar xfz "$S" mv "$S" solaar_$VERSION.orig.tar.gz -cd solaar-* -cp -a "$DEBIAN" . -ls -1 "$RULES_D"/*.rules | while read rule; do - target=`basename "$rule"` - target=${target#??-} - target=${target%.rules} - cp -av "$rule" ./debian/solaar.$target.udev -done -debuild "$@" -cp -au ../solaar_* "$DIST" +cd solaar-$VERSION +cp -a "$DEBIAN_FILES" . + +test -n "$DEBIAN_FILES_EXTRA" && cp -a $DEBIAN_FILES_EXTRA/* debian/ +# test -d debian/patches && ls -1 debian/patches/*.diff | cut -d / -f 3 > debian/patches/series + +debuild ${DEBUILD_ARGS:-$@} + +rm -rf "$DIST" +mkdir -p "$DIST" +cp -a ../solaar_$VERSION* "$DIST" +cd "$DIST" diff --git a/packaging/build_ppa.sh b/packaging/build_ppa.sh new file mode 100755 index 00000000..0349d75f --- /dev/null +++ b/packaging/build_ppa.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e + +cd `dirname "$0"`/.. + +. "$HOME/.devscripts" + +DEBIAN_CHANGELOG=$PWD/packaging/debian/changelog +PPA_CHANGELOG=$PWD/packaging/ubuntu/changelog + +latest=`head -n 1 "$DEBIAN_CHANGELOG" | sed -e 's#(\([^)]*\))#(\1ppa1)#; s#UNRELEASED#precise#'` +cat - "$DEBIAN_CHANGELOG" > "$PPA_CHANGELOG" <<_CHANGELOG +$latest + + * Customized debian/ for ubuntu launchpad ppa. + + -- $DEBFULLNAME <$DEBMAIL> $(date -R) + +_CHANGELOG + +DISTRIBUTION=ubuntu +DEBIAN_FILES_EXTRA=$PWD/packaging/ubuntu +DEBUILD_ARGS="-S" +. packaging/build_deb.sh + +rm -f "$PPA_CHANGELOG" + +#dput solaar-ppa solaar_*_source.changes diff --git a/packaging/debian/changelog b/packaging/debian/changelog index 26788fdc..6816ecab 100644 --- a/packaging/debian/changelog +++ b/packaging/debian/changelog @@ -1,4 +1,10 @@ -solaar (0.8.5-3) UNRELEASED; urgency=low +solaar (0.8.5.1-4) UNRELEASED; urgency=low + + * Customized debian/rules to support extensions. + + -- Daniel Pavel Sat, 07 Jan 2013 11:15:00 +0200 + +solaar (0.8.5.1-3) UNRELEASED; urgency=low * Fixed desktop file icon. * Fixed X-Python-Version. diff --git a/packaging/debian/control b/packaging/debian/control index f2807369..652d7943 100644 --- a/packaging/debian/control +++ b/packaging/debian/control @@ -15,7 +15,7 @@ Package: solaar Architecture: all Depends: ${misc:Depends}, ${python:Depends}, udev, python-pyudev (>= 0.13), python-gi (>= 3.2), gir1.2-gtk-3.0 (>= 3.4) Suggests: gir1.2-notify-0.7 -Description: Logitech Unifying Receiver peripherals manager for Linux. +Description: Logitech Unifying Receiver peripherals manager for Linux Solaar is a Linux device manager for Logitech's Unifying Receiver peripherals. It is able to pair/unpair devices to the receiver, and for some devices read battery status. diff --git a/packaging/debian/rules b/packaging/debian/rules index 5588304f..1e95a88e 100755 --- a/packaging/debian/rules +++ b/packaging/debian/rules @@ -3,19 +3,18 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +#export DH_OPTIONS=-v + +PREFIX = /usr +-include debian/rules.extra %: # Adding the required helpers dh $@ --with=python2 -# override_dh_auto_clean: -# dh_auto_clean -# rm -rf build/ - override_dh_auto_install: - python setup.py install --root=debian/solaar --install-layout=deb --install-lib=/usr/share/solaar/lib - -override_dh_auto_build: + dh_auto_install -- --prefix=$(PREFIX) --install-lib=$(PREFIX)/share/solaar/lib override_dh_installudev: + cp rules.d/??-logitech-unifying-receiver.rules debian/solaar.logitech-unifying-receiver.udev dh_installudev --priority=99 --name=logitech-unifying-receiver diff --git a/packaging/debian/rules.extra b/packaging/debian/rules.extra new file mode 100644 index 00000000..2d431fcd --- /dev/null +++ b/packaging/debian/rules.extra @@ -0,0 +1 @@ +# this file is included by debian/rules diff --git a/packaging/ubuntu/rules.extra b/packaging/ubuntu/rules.extra new file mode 100644 index 00000000..c0139a09 --- /dev/null +++ b/packaging/ubuntu/rules.extra @@ -0,0 +1,9 @@ +# this file is included by debian/rules + +PREFIX = /opt/extras.ubuntu.com/solaar + +# hacky... +override_dh_link: + dh_link + sed -i -e 's#Icon=solaar.png#Icon=/opt/extras.ubuntu.com/solaar/share/icons/solaar.png#' \ + debian/solaar/opt/extras.ubuntu.com/solaar/share/applications/solaar.desktop diff --git a/packaging/ubuntu/solaar.links b/packaging/ubuntu/solaar.links new file mode 100644 index 00000000..f6221876 --- /dev/null +++ b/packaging/ubuntu/solaar.links @@ -0,0 +1 @@ +opt/extras.ubuntu.com/solaar/share/applications/solaar.desktop usr/share/applications/extras-solaar.desktop diff --git a/packaging/upload_ppa.sh b/packaging/upload_ppa.sh deleted file mode 100755 index 273115ce..00000000 --- a/packaging/upload_ppa.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -cd `dirname "$0"`/.. -./packaging/build_deb.sh -S "$@" - -cd dist -sed -e 's/UNRELEASED/precise/g' -i solaar_*_source.changes -debsign --re-sign solaar_*_source.changes -dput -f solaar-ppa solaar_*_source.changes -