From a5ec921e1e23482a6203e9d0d50b003399cb862e Mon Sep 17 00:00:00 2001 From: Scott James Remnant Date: Thu, 16 Jul 2009 15:42:40 +0100 Subject: [PATCH] build libuuid binary packages The libuuid library and tools have moved from e2fsprogs to util-linux-ng, and are now built and used by default. Take the packaging data from e2fsprogs to create those packages. --- debian/control | 66 ++++++++++++++++++++++++++- debian/libuuid.copyright | 35 ++++++++++++++ debian/libuuid1-udeb.dirs | 2 + debian/libuuid1.files | 1 + debian/libuuid1.postinst | 40 ++++++++++++++++ debian/libuuid1.postrm | 10 ++++ debian/libuuid1.symbols | 20 ++++++++ debian/rules | 23 +++++++--- debian/shlibs.local | 2 + debian/uuid-dev.README.Debian | 23 ++++++++++ debian/uuid-dev.files | 4 ++ debian/uuid-runtime.files | 4 ++ debian/uuid-runtime.lintian-overrides | 1 + debian/uuid-runtime.postinst | 15 ++++++ debian/uuid-runtime.postrm | 10 ++++ debian/uuid-runtime.prerm | 10 ++++ 16 files changed, 259 insertions(+), 7 deletions(-) create mode 100644 debian/libuuid.copyright create mode 100644 debian/libuuid1-udeb.dirs create mode 100644 debian/libuuid1.files create mode 100644 debian/libuuid1.postinst create mode 100644 debian/libuuid1.postrm create mode 100644 debian/libuuid1.symbols create mode 100644 debian/uuid-dev.README.Debian create mode 100644 debian/uuid-dev.files create mode 100644 debian/uuid-runtime.files create mode 100644 debian/uuid-runtime.lintian-overrides create mode 100644 debian/uuid-runtime.postinst create mode 100644 debian/uuid-runtime.postrm create mode 100644 debian/uuid-runtime.prerm diff --git a/debian/control b/debian/control index 3d8192f8..0ead573e 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Source: util-linux -Build-Depends: libncurses5-dev, libslang2-dev (>=2.0.4), gettext, zlib1g-dev, uuid-dev, dpkg-dev (>=1.13.12), libselinux1-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], debhelper (>=5), lsb-release, pkg-config +Build-Depends: libncurses5-dev, libslang2-dev (>=2.0.4), gettext, zlib1g-dev, dpkg-dev (>=1.13.12), libselinux1-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], debhelper (>=5), lsb-release, pkg-config Section: base Priority: required Uploaders: Scott James Remnant @@ -118,6 +118,70 @@ Description: block device id library - headers and static libraries . This package contains the development environment for the blkid library. +Package: libuuid1 +Section: libs +Depends: passwd, ${shlibs:Depends} +Recommends: uuid-runtime +Replaces: e2fsprogs (<< 1.34-1) +Architecture: any +Description: Universally Unique ID library + The libuuid library generates and parses 128-bit universally unique + ids (UUIDs). A UUID is an identifier that is unique across both + space and time, with respect to the space of all UUIDs. A UUID can + be used for multiple purposes, from tagging objects with an extremely + short lifetime, to reliably identifying very persistent objects + across a network. + . + See RFC 4122 for more information. + +Package: uuid-runtime +Section: libs +Priority: optional +Depends: passwd, libuuid1 (>> 1.40.3-1), ${shlibs:Depends} +Replaces: e2fsprogs (<= 1.40.3-1ubuntu1) +Architecture: any +Description: runtime components for the Universally Unique ID library + The libuuid library generates and parses 128-bit universally unique + ids (UUIDs). A UUID is an identifier that is unique across both + space and time, with respect to the space of all UUIDs. A UUID can + be used for multiple purposes, from tagging objects with an extremely + short lifetime, to reliably identifying very persistent objects + across a network. + . + See RFC 4122 for more information. + . + This package contains the uuidgen program and the uuidd daemon. + . + The uuidd daemon is used to generate UUIDs, especially time-based + UUID’s, in a secure and guaranteed-unique fashion, even in the face + of large numbers of threads trying to grab UUID’s running on + different CPU’s. It is used by libuuid as well as the uuidgen + program. + +Package: libuuid1-udeb +XC-Package-Type: udeb +Section: debian-installer +Priority: optional +Depends: ${shlibs:Depends} +Architecture: any +Description: stripped down universally unique id library, for debian-installer + libuuid generates and parses 128-bit universally unique ids (UUIDs). + See RFC 4122 for more information. + . + This is a minimal package for debian-installer. + +Package: uuid-dev +Section: libdevel +Priority: extra +Depends: libc6-dev | libc-dev, libuuid1 (= ${binary:Version}) +Replaces: e2fslibs-dev (<< 1.15) +Architecture: any +Description: universally unique id library - headers and static libraries + libuuid generates and parses 128-bit universally unique ids (UUIDs). + See RFC 4122 for more information. + . + This package contains the development environment for the uuid library. + Package: util-linux-udeb Architecture: any Priority: optional diff --git a/debian/libuuid.copyright b/debian/libuuid.copyright new file mode 100644 index 00000000..fcb9afc6 --- /dev/null +++ b/debian/libuuid.copyright @@ -0,0 +1,35 @@ +This is libuuid, previously part of e2fsprogs this is now part of +util-linux-ng and has thus moved to the util-linux Debian source +package. + +Upstream Author: Theodore Ts'o + +Copyright: + +Copyright (C) 1999, 2000, 2003, 2004 by Theodore Ts'o + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, and the entire permission notice in its entirety, + including the disclaimer of warranties. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote + products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF +WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/debian/libuuid1-udeb.dirs b/debian/libuuid1-udeb.dirs new file mode 100644 index 00000000..bf90b050 --- /dev/null +++ b/debian/libuuid1-udeb.dirs @@ -0,0 +1,2 @@ +lib +sbin diff --git a/debian/libuuid1.files b/debian/libuuid1.files new file mode 100644 index 00000000..da600dc8 --- /dev/null +++ b/debian/libuuid1.files @@ -0,0 +1 @@ +lib/libuuid* diff --git a/debian/libuuid1.postinst b/debian/libuuid1.postinst new file mode 100644 index 00000000..5336fcfd --- /dev/null +++ b/debian/libuuid1.postinst @@ -0,0 +1,40 @@ +#!/bin/sh + +set -e + +ADDUSERCONF='/etc/adduser.conf' + +if test -f $ADDUSERCONF; then + FIRST_SYSTEM_UID=$(sed -n "s/^[[:space:]]*FIRST_SYSTEM_UID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF) + LAST_SYSTEM_UID=$(sed -n "s/^[[:space:]]*LAST_SYSTEM_UID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF) + FIRST_SYSTEM_GID=$(sed -n "s/^[[:space:]]*FIRST_SYSTEM_GID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF) + LAST_SYSTEM_GID=$(sed -n "s/^[[:space:]]*LAST_SYSTEM_GID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF) +fi + +if test -z "$FIRST_SYSTEM_UID"; then + FIRST_SYSTEM_UID=100 +fi +if test -z "$LAST_SYSTEM_UID"; then + LAST_SYSTEM_UID=999 +fi +if test -z "$FIRST_SYSTEM_GID"; then + FIRST_SYSTEM_GID=100 +fi +if test -z "$LAST_SYSTEM_GID"; then + LAST_SYSTEM_GID=999 +fi + +if ! getent group | grep -q libuuid; then + groupadd -f -K GID_MIN=$FIRST_SYSTEM_GID -K GID_MAX=$LAST_SYSTEM_GID libuuid +fi +if ! getent passwd | grep -q libuuid; then + useradd -d /var/lib/libuuid -K UID_MIN=$FIRST_SYSTEM_UID -K UID_MAX=$LAST_SYSTEM_UID -g libuuid libuuid +fi + +mkdir -p /var/lib/libuuid +chown libuuid:libuuid /var/lib/libuuid +chmod 2775 /var/lib/libuuid + +#DEBHELPER# + +exit 0 diff --git a/debian/libuuid1.postrm b/debian/libuuid1.postrm new file mode 100644 index 00000000..8c286eea --- /dev/null +++ b/debian/libuuid1.postrm @@ -0,0 +1,10 @@ +#!/bin/sh +set -e +if [ "$1" = purge ] +then + rm -rf /var/lib/libuuid +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/libuuid1.symbols b/debian/libuuid1.symbols new file mode 100644 index 00000000..03f8a616 --- /dev/null +++ b/debian/libuuid1.symbols @@ -0,0 +1,20 @@ +libuuid.so.1 libuuid1 #MINVER# + UUID_1.0@UUID_1.0 2.16-1 + uuid__generate_random@UUID_1.0 2.16-1 + uuid__generate_time@UUID_1.0 2.16-1 + uuid_clear@UUID_1.0 2.16-1 + uuid_compare@UUID_1.0 2.16-1 + uuid_copy@UUID_1.0 2.16-1 + uuid_generate@UUID_1.0 2.16-1 + uuid_generate_random@UUID_1.0 2.16-1 + uuid_generate_time@UUID_1.0 2.16-1 + uuid_is_null@UUID_1.0 2.16-1 + uuid_pack@UUID_1.0 2.16-1 + uuid_parse@UUID_1.0 2.16-1 + uuid_time@UUID_1.0 2.16-1 + uuid_type@UUID_1.0 2.16-1 + uuid_unpack@UUID_1.0 2.16-1 + uuid_unparse@UUID_1.0 2.16-1 + uuid_unparse_lower@UUID_1.0 2.16-1 + uuid_unparse_upper@UUID_1.0 2.16-1 + uuid_variant@UUID_1.0 2.16-1 diff --git a/debian/rules b/debian/rules index 441646ae..05808bd1 100755 --- a/debian/rules +++ b/debian/rules @@ -110,19 +110,30 @@ endif if [ -f debian/util-linux/sbin/hwclock ] ; then \ install -m 644 debian/hwclock.rules debian/util-linux/lib/udev/rules.d/85-hwclock.rules; \ fi - # copy library and symlink into udeb + # copy blkid library and symlink into udeb ln debian/libblkid1/lib/libblkid.so.1.* debian/libblkid1-udeb/lib/ ln debian/libblkid1/lib/libblkid.so.1 debian/libblkid1-udeb/lib/ ln debian/util-linux/sbin/blkid debian/util-linux-udeb/sbin/ # overwrite copyright install -m 644 debian/libblkid.copyright debian/libblkid1/usr/share/doc/libblkid1/copyright install -m 644 debian/libblkid.copyright debian/libblkid-dev/usr/share/doc/libblkid-dev/copyright + # copy uuid library and symlink into udeb + ln debian/libuuid1/lib/libuuid.so.1.* debian/libuuid1-udeb/lib/ + ln debian/libuuid1/lib/libuuid.so.1 debian/libuuid1-udeb/lib/ + # overwrite copyright + install -m 644 debian/libuuid.copyright debian/libuuid1/usr/share/doc/libuuid1/copyright + install -m 644 debian/libuuid.copyright debian/uuid-dev/usr/share/doc/uuid-dev/copyright + install -m 644 debian/libuuid.copyright debian/uuid-runtime/usr/share/doc/uuid-runtime/copyright # dpkg symbol handling - echo "Generating symbols for libblkid1..." - dpkg-gensymbols -plibblkid1 -Pdebian/libblkid1 > debian/libblkid1.tmp-patch - cat debian/libblkid1.tmp-patch - patch debian/libblkid1.symbols < debian/libblkid1.tmp-patch - rm debian/libblkid1.tmp-patch + for lib in libblkid1 libuuid1; \ + do \ + echo "Generating symbols for $$lib..."; \ + dpkg-gensymbols -p$$lib -Pdebian/$$lib > debian/$$lib.tmp-patch; \ + cat debian/$$lib.tmp-patch; \ + patch debian/$$lib.symbols < debian/$$lib.tmp-patch; \ + rm debian/$$lib.tmp-patch; \ + done + # cd debian; if [ -f util-linux/sbin/fdisk ]; then \ ln util-linux/sbin/*fdisk fdisk-udeb/usr/sbin/; \ S=fdisk-udeb/usr/sbin/cfdisk; if [ -f $$S ]; then mv $$S cfdisk-udeb/usr/sbin/; fi; \ diff --git a/debian/shlibs.local b/debian/shlibs.local index eaaed72e..fdebb4f6 100644 --- a/debian/shlibs.local +++ b/debian/shlibs.local @@ -1,2 +1,4 @@ libblkid 1 libblkid1 (>=1.37-1) udeb: libblkid 1 libblkid1-udeb +libuuid 1 libuuid1 (> 1.40.3-1) +udeb: libuuid 1 libuuid1-udeb diff --git a/debian/uuid-dev.README.Debian b/debian/uuid-dev.README.Debian new file mode 100644 index 00000000..3d8cc89c --- /dev/null +++ b/debian/uuid-dev.README.Debian @@ -0,0 +1,23 @@ + +In order to santize e2fsprogs to be DFSG free, the file +draft-leach-uuids-guids-01.txt has been removed. It can be obtained +by downloading e2fsprogs from the upstream sources. It may also be +available from other sites on the network, if you do a quick web +search for the string "draft-leach-uuids-guids-01". + +Note that debian/rules is set up to include the file on Ubuntu +systems, so for people trying to build e2fsprogs on Ubuntu systems, +they should start from the upstream sources, and not the +Debian-expurgated sources found in the Debian repository. (n.b., for +WIP releases the command "./util/gen-tarball ubuntu" will help create +tar file which is appropriately named to make life easier for +dpkg-buildpackage.) Since Ubuntu doesn't have the DFSG restrictions, +the documentation which has been removed for Debian's DFSG license +purity shouldn't be denied to Ubuntu users. + + Theodore Ts'o + Ocotober 3, 2006 + + + + diff --git a/debian/uuid-dev.files b/debian/uuid-dev.files new file mode 100644 index 00000000..966eed36 --- /dev/null +++ b/debian/uuid-dev.files @@ -0,0 +1,4 @@ +usr/lib/libuuid.* +usr/include/uuid +usr/share/man/man3/uuid* +usr/lib/pkgconfig/uuid.pc diff --git a/debian/uuid-runtime.files b/debian/uuid-runtime.files new file mode 100644 index 00000000..ff8d87ad --- /dev/null +++ b/debian/uuid-runtime.files @@ -0,0 +1,4 @@ +usr/bin/uuidgen +usr/sbin/uuidd +usr/share/man/man8/uuidd.* +usr/share/man/man1/uuidgen.* diff --git a/debian/uuid-runtime.lintian-overrides b/debian/uuid-runtime.lintian-overrides new file mode 100644 index 00000000..4642d30b --- /dev/null +++ b/debian/uuid-runtime.lintian-overrides @@ -0,0 +1 @@ +uuid-runtime: command-with-path-in-maintainer-script prerm:5 /usr/sbin/uuidd diff --git a/debian/uuid-runtime.postinst b/debian/uuid-runtime.postinst new file mode 100644 index 00000000..3c1adb63 --- /dev/null +++ b/debian/uuid-runtime.postinst @@ -0,0 +1,15 @@ +#!/bin/sh + +set -e +if ! getent group | grep -q libuuid; then +groupadd -f -K GID_MIN=1 -K GID_MAX=999 libuuid +fi +if ! getent passwd | grep -q libuuid; then + useradd -d /var/lib/libuuid -K UID_MIN=1 -K UID_MAX=499 -g libuuid libuuid +fi +chown libuuid:libuuid /usr/sbin/uuidd +chmod 6755 /usr/sbin/uuidd + +#DEBHELPER# + +exit 0 diff --git a/debian/uuid-runtime.postrm b/debian/uuid-runtime.postrm new file mode 100644 index 00000000..f0770011 --- /dev/null +++ b/debian/uuid-runtime.postrm @@ -0,0 +1,10 @@ +#!/bin/sh +set -e +if [ "$1" = purge ] +then + rm -rf /var/run/uuidd +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/uuid-runtime.prerm b/debian/uuid-runtime.prerm new file mode 100644 index 00000000..904e1616 --- /dev/null +++ b/debian/uuid-runtime.prerm @@ -0,0 +1,10 @@ +#! /bin/sh +set -e +if [ -x /usr/sbin/uuidd ] +then + /usr/sbin/uuidd -k || true +fi + +#DEBHELPER# + +exit 0 -- 2.39.5