diff --git a/README.md b/README.md index ec3e2b2..cc888e9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # liblockdev +Lockdev provides a reliable way to put an exclusive lock to devices using _both_ FSSTND and SVr4 methods. + diff --git a/liblockdev-1.0.0-cli.patch b/liblockdev-1.0.0-cli.patch new file mode 100644 index 0000000..1850b7b --- /dev/null +++ b/liblockdev-1.0.0-cli.patch @@ -0,0 +1,11 @@ +--- lockdev-1.0.0/src/sample.c.jbj 2002-11-29 10:10:35.000000000 -0500 ++++ lockdev-1.0.0/src/sample.c 2002-11-29 10:12:24.000000000 -0500 +@@ -31,6 +31,8 @@ + } + else dev = p; + } ++ if (dev == NULL) ++ usage(); + i = 0; + (void) dev_setpid(getppid()); + switch(ch) { diff --git a/liblockdev-1.0.0-rh.patch b/liblockdev-1.0.0-rh.patch new file mode 100644 index 0000000..6e3a4e7 --- /dev/null +++ b/liblockdev-1.0.0-rh.patch @@ -0,0 +1,474 @@ +diff -uNr lockdev-1.0.0.orig/Makefile lockdev-1.0.0/Makefile +--- lockdev-1.0.0.orig/Makefile Wed Dec 1 05:56:22 1999 ++++ lockdev-1.0.0/Makefile Fri Oct 26 11:40:18 2001 +@@ -6,6 +6,8 @@ + + objs = src/lockdev.o + ++lockdev = src/sample.c ++ + + VER = $(shell expr `pwd` : '.*-\([0-9.]*\)') + MVER = ${shell expr `pwd` : '.*-\([0-9]*\).[0-9]*'} +@@ -18,17 +20,18 @@ + basedir = /usr/local + srcdir=. + ++sbindir = ${basedir}/sbin + libdir = ${basedir}/lib + incdir = ${basedir}/include + mandir = ${basedir}/share/man + + CC = gcc +-LCFLAGS = -g -O2 -fPIC -Wall -pipe -D_REENTRANT +-CFLAGS = -g ++CFLAGS = -g -O2 -Wall -pipe ++LCFLAGS = ${CFLAGS} -fPIC -D_REENTRANT + LDLIBS = -llockdev + + .PHONY: shared static perl-lib +-ALL: shared static perl-lib ++ALL: shared static lockdev perl-lib + + static ${static}: ${objs} + $(AR) $(ARFLAGS) ${static} $^ +@@ -36,6 +39,11 @@ + shared ${shared}: ${objs} + ${CC} ${LCFLAGS} -shared -Wl,-soname,${soname} $^ -lc -o ${shared} + ++lockdev.o: ${lockdev} ++ ${CC} ${CFLAGS} -I./src -o $@ -c $^ ++ ++lockdev: lockdev.o ${static} ++ ${CC} -o $@ $^ + + perl-lib: static + cd LockDev && perl Makefile.PL INSTALLDIRS=perl +@@ -51,6 +59,7 @@ + install -m755 -d ${incdir} + install -m644 src/lockdev.h ${incdir} + install -m644 src/ttylock.h ${incdir} ++ install -m644 src/baudboy.h ${incdir} + + install_debug: ${static} ${shared} + install -m755 -d ${libdir}/debug +@@ -68,7 +77,9 @@ + + install_run: ${shared} + install -m755 -d ${libdir} +- install -m644 ${shared} ${libdir} ++ install -m755 ${shared} ${libdir} ++ install -m755 -d ${sbindir} ++ install -m755 lockdev ${sbindir} + + .PHONY: clean distclean perl-clean mostyclean + perl-clean: clean +diff -uNr lockdev-1.0.0.orig/src/baudboy.h lockdev-1.0.0/src/baudboy.h +--- lockdev-1.0.0.orig/src/baudboy.h Wed Dec 31 19:00:00 1969 ++++ lockdev-1.0.0/src/baudboy.h Fri Oct 26 11:40:26 2001 +@@ -0,0 +1,136 @@ ++/* Copyright (C) 2001 Red Hat, Inc. ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public License ++ as published by the Free Software Foundation; either version 2 of ++ the License, or (at your option) any later version. ++ ++ It is distributed in the hope that it will be useful, but WITHOUT ++ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ++ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General ++ Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this software; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++ ++#ifndef _BAUDBOY_H_ ++#define _BAUDBOY_H_ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#define LOCKDEV_PATH "/usr/sbin/lockdev" ++ ++static inline int doit(const char * argv[]) ++{ ++ pid_t child; ++ int status; ++ void (*osig) (int) = signal(SIGCHLD, SIG_IGN); ++ int rc; ++ ++ if (!(child = fork())) { ++ int fd; ++ /* these have to be open to something */ ++ if ((fd = open("/dev/null", 2)) < 0) ++ exit(-1); ++ dup2(fd, 0); ++ dup2(fd, 1); ++ dup2(fd, 2); ++ close(fd); ++ /* Swap egid and gid for lockdev's access(2) device check. */ ++ setregid(getegid(), getgid()); ++ execv(argv[0], (char *const *)argv); ++ exit(-1); ++ } ++ ++ rc = (int) waitpid(child, &status, 0); ++ signal(SIGCHLD, osig); ++ if (rc == child && WIFEXITED(status)) { ++ /* ++ * Exit dev_lock dev_unlock dev_testlock ++ * 0 OK OK not locked ++ * 1 locked other locked other locked ++ * 2 EACCES ++ * 3 EROFS ++ * 4 EFAULT ++ * 5 EINVAL ++ * 6 ENAMETOOLONG ++ * 7 ENOENT ++ * 8 ENOTDIR ++ * 9 ENOMEM ++ * 10 ELOOP ++ * 11 EIO ++ * 255 error error error ++ */ ++ rc = WEXITSTATUS(status); ++ switch(rc) { ++ case 0: rc = 0; break; ++ default: ++ case 1: rc = -EPERM; break; ++ case 2: rc = -EACCES; break; ++ case 3: rc = -EROFS; break; ++ case 4: rc = -EFAULT; break; ++ case 5: rc = -EINVAL; break; ++ case 6: rc = -ENAMETOOLONG; break; ++ case 7: rc = -ENOENT; break; ++ case 8: rc = -ENOTDIR; break; ++ case 9: rc = -ENOMEM; break; ++ case 10: rc = -ELOOP; break; ++ case 11: rc = -EIO; break; ++ } ++ } else if (rc == -1) ++ rc = -errno; ++ else ++ rc = -ECHILD; ++ ++ return rc; ++ ++} ++ ++static inline int ttylock(const char * devname) ++{ ++ const char * argv[] = { LOCKDEV_PATH, "-l", NULL, NULL}; ++ argv[2] = devname; ++ return doit(argv); ++} ++ ++static inline int ttyunlock(const char * devname) ++{ ++ const char * argv[] = { LOCKDEV_PATH, "-u", NULL, NULL}; ++ argv[2] = devname; ++ return doit(argv); ++} ++ ++static inline int ttylocked(const char * devname) ++{ ++ const char * argv[] = { LOCKDEV_PATH, NULL, NULL}; ++ argv[1] = devname; ++ return doit(argv); ++} ++ ++static inline int ttywait(const char * devname) ++{ ++ int rc; ++ while((rc = ttylocked(devname)) == 0) ++ sleep(1); ++ return rc; ++} ++ ++#ifdef __cplusplus ++}; ++#endif ++ ++#endif /* _BAUDBOY_H_ */ +diff -uNr lockdev-1.0.0.orig/src/lockdev.c lockdev-1.0.0/src/lockdev.c +--- lockdev-1.0.0.orig/src/lockdev.c Wed Dec 1 06:43:47 1999 ++++ lockdev-1.0.0/src/lockdev.c Fri Oct 26 11:40:18 2001 +@@ -176,6 +176,19 @@ + liblockdev_debug = 0; + } + ++static pid_t dev_pid = 0; ++ ++pid_t dev_getpid(void) ++{ ++ return (dev_pid ? dev_pid : getpid()); ++} ++ ++pid_t dev_setpid(pid_t newpid) ++{ ++ pid_t oldpid = dev_pid; ++ dev_pid = newpid; ++ return oldpid; ++} + + /* + * for internal use * +@@ -429,7 +442,7 @@ + * maybe also this sprintf should be added to the + * conditional part, as the others + */ +- sprintf( tpname, "%s/.%d", LOCK_PATH, (int)getpid()); ++ sprintf( tpname, "%s/.%d", LOCK_PATH, (int)dev_getpid()); + unlink( tpname); /* in case there was */ + rename( lockname, tpname); + if ( ! (fd=fopen( tpname, "r")) ) { +@@ -520,7 +533,7 @@ + * and minor numbers + */ + if ( stat( device, &statbuf) == -1 ) { +- close_n_return( -1); ++ close_n_return(-errno); + } + + /* first check for the FSSTND-1.2 lock, get the pid of the +@@ -586,7 +599,7 @@ + #endif /* DEBUG */ + _debug( 3, "dev_lock(%s)\n", devname); + if (oldmask == -1 ) +- oldmask = umask( 0); /* give full permissions to files created */ ++ oldmask = umask( 002); /* apply o-w to files created */ + if ( ! (p=_dl_check_devname( devname)) ) + close_n_return( -1); + strcpy( device, DEV_PATH); +@@ -597,11 +610,14 @@ + * and minor numbers + */ + if ( stat( device, &statbuf) == -1 ) { +- close_n_return( -1); ++ close_n_return(-errno); ++ } ++ if ( access( device, W_OK ) == -1 ) { ++ close_n_return(-errno); + } + + /* now get our own pid */ +- our_pid = getpid(); ++ our_pid = dev_getpid(); + _debug( 2, "dev_lock() our own pid = %d\n", (int)our_pid); + + /* We will use this algorithm: +@@ -642,8 +658,9 @@ + _dl_filename_1( lock1, &statbuf); + while ( ! (pid=_dl_check_lock( lock1)) ) { + if (( link( lock0, lock1) == -1 ) && ( errno != EEXIST )) { ++ int rc = -errno; + unlink( lock0); +- close_n_return( -1); ++ close_n_return(rc); + } + } + if ( pid != our_pid ) { +@@ -660,9 +677,10 @@ + /* lockfile of type /var/lock/LCK..ttyS2 */ + while ( ! (pid=_dl_check_lock( lock2)) ) { + if (( link( lock0, lock2) == -1 ) && ( errno != EEXIST )) { ++ int rc = -errno; + unlink( lock0); + unlink( lock1); +- close_n_return( -1); ++ close_n_return(rc); + } + } + if ( pid != our_pid ) { +@@ -742,7 +760,7 @@ + #endif /* DEBUG */ + _debug( 3, "dev_relock(%s, %d)\n", devname, (int)old_pid); + if (oldmask == -1 ) +- oldmask = umask( 0); /* give full permissions to files created */ ++ oldmask = umask( 002); /* apply o-w to files created */ + if ( ! (p=_dl_check_devname( devname)) ) + close_n_return( -1); + strcpy( device, DEV_PATH); +@@ -753,11 +771,14 @@ + * and minor numbers + */ + if ( stat( device, &statbuf) == -1 ) { +- close_n_return( -1); ++ close_n_return(-errno); ++ } ++ if ( access( device, W_OK ) == -1 ) { ++ close_n_return(-errno); + } + + /* now get our own pid */ +- our_pid = getpid(); ++ our_pid = dev_getpid(); + _debug( 2, "dev_relock() our own pid = %d\n", (int)our_pid); + + /* first check for the FSSTND-1.2 lock, get the pid of the +@@ -828,7 +849,7 @@ + #endif /* DEBUG */ + _debug( 3, "dev_unlock(%s, %d)\n", devname, (int)pid); + if (oldmask == -1 ) +- oldmask = umask( 0); /* give full permissions to files created */ ++ oldmask = umask( 002); /* apply o-w to files created */ + if ( ! (p=_dl_check_devname( devname)) ) + close_n_return( -1); + strcpy( device, DEV_PATH); +@@ -839,7 +860,10 @@ + * and minor numbers + */ + if ( stat( device, &statbuf) == -1 ) { +- close_n_return( -1); ++ close_n_return(-errno); ++ } ++ if ( access( device, W_OK ) == -1 ) { ++ close_n_return(-errno); + } + + /* first remove the FSSTND-1.2 lock, get the pid of the +diff -uNr lockdev-1.0.0.orig/src/lockdev.h lockdev-1.0.0/src/lockdev.h +--- lockdev-1.0.0.orig/src/lockdev.h Wed Dec 1 06:39:42 1999 ++++ lockdev-1.0.0/src/lockdev.h Fri Oct 26 11:40:18 2001 +@@ -53,6 +53,7 @@ + #endif + + #include ++#include + + + /* API of the library */ +@@ -60,6 +61,9 @@ + void liblockdev_incr_debug __P(()); + void liblockdev_reset_debug __P(()); + ++pid_t dev_getpid __P(( void )); ++pid_t dev_setpid __P(( pid_t pid )); ++ + pid_t dev_testlock __P(( const char * devname)); + + pid_t dev_lock __P(( const char * devname)); +diff -uNr lockdev-1.0.0.orig/src/sample.c lockdev-1.0.0/src/sample.c +--- lockdev-1.0.0.orig/src/sample.c Wed Dec 1 06:50:09 1999 ++++ lockdev-1.0.0/src/sample.c Fri Oct 26 11:40:18 2001 +@@ -3,27 +3,26 @@ + + void + usage() { +- fprintf( stderr, "Usage: sample [-lurd] \n" ); +- exit( -1 ); ++ fprintf(stderr, "Usage: %s [-lud] \n", "lockdev"); ++ exit(-1); + } + + int debug; + + + int +-main( int argc, char *argv[] ) ++main(int argc, char *argv[]) + { + int i, chld; +- char *p, *dev, ch; ++ char *p = NULL, *dev = NULL, ch; + + ch = '\0'; +- for( i = argc - 1; i > 0; i-- ) { ++ for (i = argc - 1; i > 0; i--) { + p = argv[i]; +- if( *p == '-' ) { +- switch( *++p ) { ++ if (*p == '-') { ++ switch(*++p) { + case 'l': +- case 'u': +- case 'r': ch = *p; break; ++ case 'u': ch = *p; break; + case 'd': + debug = atoi(++p); + break; +@@ -32,31 +31,52 @@ + } + else dev = p; + } +- fprintf( stderr, "option %c, device %s\n", ch, dev ); + i = 0; +- switch( ch ) { ++ (void) dev_setpid(getppid()); ++ switch(ch) { + case 'l': +- i = dev_lock( dev); ++ i = dev_lock(dev); + break; + case 'u': +- i = dev_unlock( dev, 0); +- break; +- case 'r': +- dev_lock( dev); +- if(( chld = fork()) == 0 ) { +- sleep(5); +- } +- else { +- sleep( 1); +- if (( i = dev_relock( dev, chld)) < 0 ) { +- fprintf( stderr, "Relock failed in parent.\n" ); +- } +- } ++ i = dev_unlock(dev, 0); + break; + default: +- i = dev_testlock( dev); ++ if (dev) ++ i = dev_testlock(dev); + break; + } +- exit( i); +-} + ++ /* ++ * Exit dev_lock dev_unlock dev_testlock ++ * 0 OK OK not locked ++ * 1 locked other locked other locked ++ * 2 EACCES ++ * 3 EROFS ++ * 4 EFAULT ++ * 5 EINVAL ++ * 6 ENAMETOOLONG ++ * 7 ENOENT ++ * 8 ENOTDIR ++ * 9 ENOMEM ++ * 10 ELOOP ++ * 11 EIO ++ * 255 error error error ++ */ ++ switch (i) { ++ case -EACCES: i = 2; break; ++ case -EROFS: i = 3; break; ++ case -EFAULT: i = 4; break; ++ case -EINVAL: i = 5; break; ++ case -ENAMETOOLONG: i = 6; break; ++ case -ENOENT: i = 7; break; ++ case -ENOTDIR: i = 8; break; ++ case -ENOMEM: i = 9; break; ++ case -ELOOP: i = 10; break; ++ case -EIO: i = 11; break; ++ default: ++ if (i < 0) i = 255; ++ else if (i > 0) i = 1; ++ break; ++ } ++ exit(i); ++} diff --git a/liblockdev-1.0.0-shared.patch b/liblockdev-1.0.0-shared.patch new file mode 100644 index 0000000..d5c9993 --- /dev/null +++ b/liblockdev-1.0.0-shared.patch @@ -0,0 +1,19 @@ +--- lockdev-1.0.0/Makefile Mon Feb 25 15:36:06 2002 ++++ lockdev-1.0.0/Makefile Mon Feb 25 15:36:02 2002 +@@ -13,7 +13,7 @@ + MVER = ${shell expr `pwd` : '.*-\([0-9]*\).[0-9]*'} + + static = ${libname}.a +-shared = ${libname}.${VER}.so ++shared = ${libname}.so.${VER} + soname = ${libname}.so.${MVER} + + # overwritten by caller (e.g.: debian/rules) +@@ -78,6 +78,7 @@ + install_run: ${shared} + install -m755 -d ${libdir} + install -m755 ${shared} ${libdir} ++ ln -s ${shared} ${libdir}/liblockdev.so + install -m755 -d ${sbindir} + install -m755 lockdev ${sbindir} + diff --git a/liblockdev-1.0.0-signal.patch b/liblockdev-1.0.0-signal.patch new file mode 100644 index 0000000..997c002 --- /dev/null +++ b/liblockdev-1.0.0-signal.patch @@ -0,0 +1,41 @@ +--- lockdev-1.0.0/src/baudboy.h Sat Apr 20 15:42:16 2002 ++++ lockdev-1.0.0-/src/baudboy.h Sat Apr 20 15:41:49 2002 +@@ -34,11 +34,11 @@ + + #define LOCKDEV_PATH "/usr/sbin/lockdev" + +-static inline int doit(const char * argv[]) ++static inline int _doit(const char * argv[]) + { + pid_t child; + int status; +- void (*osig) (int) = signal(SIGCHLD, SIG_IGN); ++ void (*osig) (int) = signal(SIGCHLD, SIG_DFL); + int rc; + + if (!(child = fork())) { +@@ -104,21 +104,21 @@ + { + const char * argv[] = { LOCKDEV_PATH, "-l", NULL, NULL}; + argv[2] = devname; +- return doit(argv); ++ return _doit(argv); + } + + static inline int ttyunlock(const char * devname) + { + const char * argv[] = { LOCKDEV_PATH, "-u", NULL, NULL}; + argv[2] = devname; +- return doit(argv); ++ return _doit(argv); + } + + static inline int ttylocked(const char * devname) + { + const char * argv[] = { LOCKDEV_PATH, NULL, NULL}; + argv[1] = devname; +- return doit(argv); ++ return _doit(argv); + } + + static inline int ttywait(const char * devname) diff --git a/liblockdev-1.0.1-checkname.patch b/liblockdev-1.0.1-checkname.patch new file mode 100644 index 0000000..8ab2aaf --- /dev/null +++ b/liblockdev-1.0.1-checkname.patch @@ -0,0 +1,28 @@ +--- lockdev-1.0.1/src/lockdev.c.orig 2003-08-18 17:13:31.000000000 -0400 ++++ lockdev-1.0.1/src/lockdev.c 2003-08-18 17:13:43.000000000 -0400 +@@ -487,17 +487,18 @@ + * maybe we should check it and do something if not? + */ + p = devname; /* only a filename */ +- while ( (m=strrchr( p, '/')) != 0 ) { +- p = m+1; /* was pointing to the slash */ ++ p += strspn(p, " \t\r\n\v\f\a"); /* skip leading whitespace */ ++ if (strncmp(p, DEV_PATH, strlen(DEV_PATH)) == 0) { ++ p += strlen(DEV_PATH); /* 1st char after slash */ + _debug( 3, "_dl_check_devname(%s) name = %s\n", devname, p); + if ( strcmp( p, "tty") == 0 ) + p = ttyname( 0); /* this terminal, if it exists */ + } +- if ( ((l=strlen( p)) == 0 ) || ( l > (MAXPATHLEN - strlen(LOCK_PATH)) )) +- return 0; +- if ( ! (m = malloc( 1 + l)) ) +- return 0; +- return strcpy( m, p); ++ if (((l = strlen(p)) == 0) || (l > (MAXPATHLEN - strlen(LOCK_PATH)))) ++ return NULL; ++ if ((m = malloc(++l)) == NULL) ++ return NULL; ++ return strcpy(m, p); + } + + diff --git a/liblockdev.spec b/liblockdev.spec new file mode 100644 index 0000000..e9de35d --- /dev/null +++ b/liblockdev.spec @@ -0,0 +1,106 @@ +%define tty_groupid 4 +%define majver %(echo %version | cut -d_ -f1) +%define minver %(echo %version | cut -d_ -f2) +Name: liblockdev +Version: 1.0.3_1.5 +Release: 1mamba +Summary: A library to put an exclusive lock to devices +Group: System/Kernel and Hardware +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://ftp.debian.org/debian/pool/main/l/lockdev +Source: http://ftp.debian.org/debian/pool/main/l/lockdev/lockdev_%{majver}.orig.tar.gz +Patch0: http://ftp.debian.org/debian/pool/main/l/lockdev/lockdev_%{majver}-%{minver}.diff.gz +Patch1: %{name}-1.0.0-rh.patch +Patch2: %{name}-1.0.0-shared.patch +Patch3: %{name}-1.0.0-signal.patch +Patch4: %{name}-1.0.0-cli.patch +Patch5: %{name}-1.0.1-checkname.patch +License: LGPL +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +Lockdev provides a reliable way to put an exclusive lock to devices using _both_ FSSTND and SVr4 methods. + +%package devel +Summary: Devel package for liblockdev +Group: Development/Libraries +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description devel +Lockdev provides a reliable way to put an exclusive lock to devices using _both_ FSSTND and SVr4 methods. +This package contains static libraries and header files need for development. + +%prep +%setup -q -n lockdev-%{majver} +%patch0 -p1 +#%patch1 -p1 +#%patch2 -p1 +#%patch3 -p1 +#%patch4 -p1 +#%patch5 -p1 + +%build +%make basedir=%{_prefix} CFLAGS="%{optflags} -fPIC" CC="%{_host}-gcc" \ +%if "%{stage1}" == "1" + shared static +%endif + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +make install basedir=%{buildroot}%{_prefix} libdir=%{buildroot}%{_libdir} + +ln -s liblockdev.so.1.0.1 %{buildroot}%{_libdir}/liblockdev.so.1 +install -d %{buildroot}/var/lock/subsys + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post +/sbin/ldconfig +groupadd tty -g %{tty_groupid} 2>/dev/null +: + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +#%attr(2755,root,tty) %{_sbindir}/lockdev +%attr(1775,root,tty) %dir %{_localstatedir}/lock +%{_libdir}/liblockdev.so.* + +%files devel +%defattr(-,root,root) +%{_includedir}/*.h +%{_libdir}/*.a +%{_libdir}/*.so +%{_mandir}/man3/* + +%changelog +* Sat Apr 27 2013 Automatic Build System 1.0.3_1.5-1mamba +- update to 1.0.3_1.5 + +* Sun Dec 27 2009 Silvan Calarco 1.0.3-2mamba +- rebuilt to remove executable requirements + +* Mon Jan 05 2009 Silvan Calarco 1.0.3-1mamba +- automatic update by autodist + +* Fri Jan 19 2007 Davide Madrisan 1.0.1-6qilnx +- rebuild library with fPIC + +* Fri Feb 10 2006 Silvan Calarco 1.0.1-5qilnx +- create tty group + +* Wed Jan 18 2006 Davide Madrisan 1.0.1-4qilnx +- specfile fixed + +* Thu Apr 29 2004 Silvan Calarco 1.0.1-3qilnx +- /var/lock directory moved here from filesystem + +* Tue Apr 13 2004 Silvan Calarco 1.0.1-2qilnx +- redhat patches added + +* Fri Apr 09 2004 Silvan Calarco 1.0.1-1qilnx +- first build diff --git a/lockdev_1.0.3-1.5.diff b/lockdev_1.0.3-1.5.diff new file mode 100644 index 0000000..020c035 --- /dev/null +++ b/lockdev_1.0.3-1.5.diff @@ -0,0 +1,689 @@ +--- lockdev-1.0.3.orig/debian/liblockdev1-dbg.docs ++++ lockdev-1.0.3/debian/liblockdev1-dbg.docs +@@ -0,0 +1 @@ ++README.debug +--- lockdev-1.0.3.orig/debian/compat ++++ lockdev-1.0.3/debian/compat +@@ -0,0 +1 @@ ++4 +--- lockdev-1.0.3.orig/debian/changelog ++++ lockdev-1.0.3/debian/changelog +@@ -0,0 +1,341 @@ ++lockdev (1.0.3-1.5) unstable; urgency=low ++ ++ * Non-maintainer upload. ++ * Fix hurd-i386 FTBFS (Closes: #668951). ++ ++ -- Samuel Thibault Fri, 08 Jun 2012 01:49:05 +0200 ++ ++lockdev (1.0.3-1.4) unstable; urgency=low ++ ++ * Non-maintainer upload. ++ * Don't install copyright in both liblockdev1 and liblockdev1-dbg as ++ they share the same folde rin /usr/share/doc via symlink (Closes: ++ #563600) ++ * Use binary:Version instead of Source-Version ++ ++ -- Christoph Egger Fri, 19 Feb 2010 19:10:38 +0100 ++ ++lockdev (1.0.3-1.3) unstable; urgency=low ++ ++ * Non-maintainer upload. ++ * Don't remove non-existant file (Closes: #549731) ++ * Add ${shlibs:Depends} to -perl and -db (Closes: #553240, #553242) ++ * -dbg package is section debug ++ * add misc:Depends ++ ++ -- Christoph Egger Wed, 30 Dec 2009 20:50:40 +0100 ++ ++lockdev (1.0.3-1.2) unstable; urgency=low ++ ++ * Non-maintainer upload. ++ * Brown paperbag release: Fix uninstallability of the -dbg-package. ++ Closes: #400676 ++ ++ -- Andreas Barth Tue, 28 Nov 2006 08:52:55 +0100 ++ ++lockdev (1.0.3-1.1) unstable; urgency=low ++ ++ * Non-maintainer upload. ++ * Fix postinst. Closes: #366384 ++ + don't use numerical compares for version history, but ++ dpkg --compare-versions ++ + do never wait for someone entering a key - that could be in ++ non-interactive mode ... ++ * Add upgrade information into NEWS.Debian. ++ ++ -- Andreas Barth Mon, 27 Nov 2006 13:11:32 +0100 ++ ++lockdev (1.0.3-1) unstable; urgency=low ++ ++ * New release ++ * Distinguish character and block devices when creating SVR4 type lockfiles ++ (closes: #331249) ++ * Fixed some typos in comments ++ ++ -- Paweł Więcek Thu, 20 Apr 2006 21:11:48 +0200 ++ ++lockdev (1.0.2-1) unstable; urgency=low ++ ++ * New release. ++ * debian/control: ++ + Added myself as an uploader. Thanks to Pawel Wiecek for granting ++ me co-maintainership. ++ + Build-Depend upon debhelper 4. ++ + Update to Standards-Version 3.6.2. ++ * debian/copyright: ++ + Update FSF address. ++ + Add myself as a contributor. ++ * debian/compat: Use debhelper v4. ++ * Remove all postinst and preinst templates; debhelper v4 generates ++ ldconfig calls automatically. ++ * Devices within subdirectories of /dev are locked properly, using ++ ':' as a path delimiter in the device lock name. For example, ++ /dev/pts/2 is locked as /var/lock/LCK..pts:2 ++ (Closes: #115109, #135299). ++ * Device major and minor numbers are computed using GNU libc ++ builtins, rather than kernel headers (Closes: #331139). ++ * src/sample.c debugging is amended to use the proper debugging ++ functions (Closes: #331255). ++ ++ -- Roger Leigh Mon, 3 Oct 2005 20:55:51 +0100 ++ ++lockdev (1.0.1-7) unstable; urgency=low ++ ++ * Applied patch from Aurelien Jarno to support ++ GNU/k*BSD (closes: #302457) ++ * Fixed patch from 1.0.1-5.1 NMU to clean after itself (!) ++ ++ -- Pawel Wiecek Thu, 19 May 2005 21:25:43 +0200 ++ ++lockdev (1.0.1-6) unstable; urgency=low ++ ++ * Applied patch from Kristof Koehler ++ to fix behavior when device is ++ locked by process with different UID (closes: #215807) ++ ++ -- Pawel Wiecek Thu, 22 Jan 2004 14:34:28 +0100 ++ ++lockdev (1.0.1-5.1) unstable; urgency=low ++ ++ * NMU ++ * Use -fPIC code in shared lib. Closes: #190770 ++ ++ -- LaMont Jones Sat, 7 Jun 2003 19:27:24 -0600 ++ ++lockdev (1.0.1-5) unstable; urgency=low ++ ++ * Completely repackaged, so it now uses standard procedures instead of some ++ mysterious stuff (closes: #166600) ++ * Updated standards version ++ * Included perl 5.8 patch from -4.1 NMU (closes: #158941) ++ * Fixed a couple of lintian errors and warnings ++ ++ -- Pawel Wiecek Fri, 25 Apr 2003 14:17:02 +0200 ++ ++lockdev (1.0.1-4.1) unstable; urgency=low ++ ++ * NMU for perl 5.8. ++ * Bump perl build-dependency to >= 5.8.0-7. ++ ++ -- Colin Watson Sat, 31 Aug 2002 00:29:56 +0100 ++ ++lockdev (1.0.1-4) unstable; urgency=low ++ ++ * New maintainer (closes: #112558) ++ * Removed umask calls (closes: #115108) ++ * Now calls ldconfig in postrm instead of prerm ++ ++ -- Pawel Wiecek Tue, 9 Apr 2002 14:39:54 +0200 ++ ++lockdev (1.0.1-3) unstable; urgency=low ++ ++ * debian/copyright: upstream location changed back to the Debian ftp ++ archives ++ * debian/control (Standards-Version): bumped to 3.5.6 ++ (Maintainer): set to Debian QA Team ++ * debian/policy: standards-version bumped to 3.5.6 ++ ++ -- Gergely Nagy Sun, 16 Sep 2001 22:34:51 +0200 ++ ++lockdev (1.0.1-2) unstable; urgency=low ++ ++ * Added missing symlinks to some manual pages (Closes: #99549) ++ * Standards-Version bumped to 3.5.5 ++ * Only call ldconfig upon configure and remove ++ ++ -- Gergely Nagy Sun, 10 Jun 2001 09:41:20 +0200 ++ ++lockdev (1.0.1-1) unstable; urgency=low ++ ++ * New maintainer ++ * Acknowledge NMU: Closes: #41522 ++ * Recompiled with new perl (Closes: #80662) ++ * Corrected missing symlink bug (Closes: #88888) ++ * Updated to latest perl policy (Closes: #95410) ++ * Added build-depends ++ * Bumped Standards-Version to 3.5.4 ++ ++ -- Gergely Nagy Wed, 23 May 2001 17:24:23 +0200 ++ ++lockdev (1.0.0) unstable; urgency=low ++ ++ * added management of pseudo device /dev/tty , thanx to Alan Cox. ++ * added unconditional malloc of supplied device argoment. ++ * changed name of the shared lib to end in .so ++ * changed Makefile.PL because the perl manpage disappeared. ++ * Changed symbols in the API as suggested by Daniel Quinlan and ++ Erik Troan. Changed soname accordingly. ++ * Corrected manpages and added LSB proposal (draft 2). ++ * corrected cua device management: use linux/major.h to determine the ++ cua major number; conditioned to __linux__ ++ * Changed LICENSE file to hold the LGPL 2.1 ++ ++ -- Fabrizio Polacco Wed, 1 Dec 1999 12:59:10 +0200 ++ ++lockdev (0.11.1) unstable; urgency=low ++ ++ * NMU for the perl upgrade. Closes: #41522 ++ * Corrected the rules files to conform to perl policy 1.0.1. ++ * Compiled with perl-5.005. ++ * Corrected the location of the license. ++ * Upgraded standards-version to 2.5.1 ++ ++ -- Raphael Hertzog Mon, 19 Jul 1999 20:51:00 +0200 ++ ++lockdev (0.11) unstable; urgency=low ++ ++ * Avoided repetute locking of the semaphore. ++ * Corrected special case of semaphore misbehaviour (found while ++ crosschecking between two instancies running under gdb). ++ * Added modification on-the-fly of major number of device from 4 to 5 ++ in case it was referring to one of the 64 cua devices; it now locks ++ the major+minor numbers of the corresponding ttyS device. The name ++ remains unaffected, as it could be an arbitrary name. ++ (Thanx to Daniel Quinlan ) ++ * Tryed to use fcntl instead of flock, after suggestion of Daniel ++ Quinlan, to permit use on NFS mounted partitions. ++ I wasn't able to make it correctly work, so I conditioned the ++ changes and left the code there, for further (future) ++ investigations. Any help highly appreciated. ++ * changed third file (LCK..) to have three dots, and made it stay ++ there, as a quick reference. It doesn't hurt, and shouw the pid with ++ a simple ls -l ++ * Added full text of LGPL licence instead of GPL one added in the ++ previous version (oops). ++ ++ -- Fabrizio Polacco Wed, 2 Jun 1999 15:58:03 +0300 ++ ++lockdev (0.10) unstable; urgency=low ++ ++ * Added ttylock.h as Compatibility API to AIX. Programs written for ++ that environment can be linked directly to lockdev library. ++ (On AIX the symbols are in libc, so special care should be used) ++ * changed location of manpages to /usr/share/man. ++ * changed the name of the source to lockdev_0.10.tar.gz ++ * changed address of FSF in Copyright file, added the full GPL text as ++ LICENSE (only in the source), corrected name of the mailing list. ++ * changed name of changelog, just to make lintian happier. ++ * corrected name of docs dir for perl package. ++ ++ -- Fabrizio Polacco Thu, 8 Apr 1999 21:04:53 +0300 ++ ++liblockdev (0.9a) frozen unstable; urgency=low ++ ++ * Added more tests in postinst of liblockdev0g-dbg, to avoid strange ++ problems encountered by Adam P. Harris (closes: #22565) ++ ++ -- Fabrizio Polacco Mon, 18 May 1998 15:21:12 +0300 ++ ++liblockdev (0.9) frozen unstable; urgency=low ++ ++ * cleaned symlinks in docs dirs. ++ * changed libs symlinks from /usr/lib to /lib ++ * stripped main shared library. ++ * Corrected wrong shlibs dependency (thanx to Hamish Moffatt, ++ closes: #22282). ++ * Changed dependency of -dev from libc6 to libc6-dev, ++ thanx to James Troup (closes: #16476). ++ * Added -I.. in Makefile.PL to allow compilation of the perl part even ++ when the -dev package isn't installed (thanx to Martin Schulze for ++ the patch) closes: #15834 ++ ++ -- Fabrizio Polacco Tue, 12 May 1998 13:39:27 +0300 ++ ++liblockdev (0.8) unstable; urgency=low ++ ++ * updated manpage (degugging section). ++ * added environment variable to set debug value, and signals ++ to change those values at runtime (if compiled with -DDEBUG). ++ * avoided symlink to /usr/src changing .stab in asm source ++ file (overwritten implicit rule to produce asm source). ++ Thanx to Martin Schulze for the help. ++ * changed dbg package to install shared debug lib in ++ /usr/lib/debug and profile lib in /usr/lib/profile. ++ * splitted debian/rules in included debian/policy ++ * cleaned Makefile and changed to build debug shared lib. ++ Thanx to Yann Dirson. ++ * added change in umask value to allow full permissions to lock ++ files. (this is questionable: would it be better to add a ++ suid program to check and remove dangling locks?) ++ ++ -- Fabrizio Polacco Tue, 23 Dec 1997 11:26:10 +0200 ++ ++liblockdev (0.7) unstable; urgency=low ++ ++ * cleaned Makefile and debian/rules ++ * change in Makefile.PL to allow pristine compilation on new systems ++ (closes: #15834, thanx to Martin Schulze). ++ * added -dbg package with debug and profile libs. ++ * problem with lenght of dev_t in glibc for printf: cast needed :-) ++ * corrected ftp address in copyright file. ++ ++ -- Fabrizio Polacco Sun, 30 Nov 1997 01:00:50 +0200 ++ ++liblockdev (0.6) unstable; urgency=low ++ ++ * added symlink to dirs in /usr/doc (one dir for all packages), ++ now /usr/doc/liblockdev is a symlink installed by -dev package, ++ as the liblockdev.a and liblockdev.so symlinks. ++ Instead, lblockdev-perl installs a copy of the docs because ++ it doesn't depend on the run-time binary package (as -dev does). ++ * cleaned spreading in the distribution: ++ source and run-time to section 'libs', development into 'devel', ++ perl module into 'interpreters' (waiting for a perl section). ++ * created extension perl library LockDev:: with manpage LockDev(3pm) ++ and packaged as liblockdev0-perl. ++ * moved symlink so.0 -> so.0.6 to runtime package. ++ * added unlink of semaphore file (not really needed, just to clean up) ++ * corrected error in Synopsis of manpage (oops). ++ * cleaned source code: changed ANSI-C definition of functions to K&R, ++ as recommended in GNU coding style (but not for indentation). ++ Added ANSI-C prototypes for internal functions (exported one ++ already have them in .h interface file. ++ * cleaned rules file, got rid of unneeded libc5 compatibility. ++ * Moved back include of stdio.h from lockdev.h to .c (closes:Bug#14154) ++ Thanx to Juan Cespedes ++ * Corrected debian/rules to have binary-arch rule (closes:Bug#14062) ++ ++ -- Fabrizio Polacco Wed, 22 Oct 1997 13:45:34 +0300 ++ ++liblockdev (0.5) unstable; urgency=low ++ ++ * moved to libc6 (glibc2); added a "g" after soname in package name. ++ * added rules to build also compatibility libc5 libs. ++ ++ -- Fabrizio Polacco Thu, 25 Sep 1997 11:51:22 +0300 ++ ++liblockdev0 (0.4) unstable; urgency=low ++ ++ * Changed priority from extra to optional. ++ * cleaned Makefile and added separate static/debug library. ++ * Cleaned include file. ++ * Added global var liblockdev_debug for debugging level ++ * Added 2 functions to set and reset debugging level (only in static lib) ++ ++ -- Fabrizio Polacco Sat, 6 Sep 1997 02:20:01 +0300 ++ ++liblockdev0 (0.3) unstable; urgency=low ++ ++ * avoided stripping of static lib (compiled with -DDEBUG) ++ * added semaphore lock to avoid race condition in ++ removing stale locks (thanx to Barak Pearlmutter) ++ * changed unlink of stale lock to a complex and ++ convoluted way to avoid conflicts between us and another ++ process that doesn't use this library. Still exists the ++ possibility of a conflict between two other processes that ++ don't use this library, but we are safe. ++ * cleaned code in lock_dev() ++ ++ -- Fabrizio Polacco Fri, 5 Sep 1997 11:05:21 +0300 ++ ++liblockdev0 (0.2) unstable; urgency=low ++ ++ * fixed shared lib links. ++ ++ -- Fabrizio Polacco Thu, 4 Sep 1997 19:08:38 +0300 ++ ++liblockdev0 (0.1) unstable; urgency=low ++ ++ * Initial Release. ++ ++ -- Fabrizio Polacco Thu, 4 Sep 1997 14:13:23 +0300 +--- lockdev-1.0.3.orig/debian/rules ++++ lockdev-1.0.3/debian/rules +@@ -0,0 +1,145 @@ ++#!/usr/bin/make -f ++# Sample debian/rules that uses debhelper. ++# GNU copyright 1997 to 1999 by Joey Hess. ++ ++# Uncomment this to turn on verbose mode. ++#export DH_VERBOSE=1 ++ ++ ++ifndef PERL ++PERL = /usr/bin/perl ++endif ++ ++archlib = `$(PERL) -MConfig -e 'print $$Config{installarchlib}'` ++config = INSTALLDIRS=vendor ++config += INSTALLMAN1DIR=${d_man}/man1 ++config += INSTALLMAN3DIR=${d_man}/man3 ++config += INSTALLPRIVLIB=${d_ulib}/perl5 ++config += INSTALLARCHLIB=${d_build}$(archlib) ++PERLVERSION=`$(PERL) -MConfig -e 'print $$Config{version}'` ++ ++ ++ ++CFLAGS = -Wall -g ++ ++ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) ++ CFLAGS += -O0 ++else ++ CFLAGS += -O2 ++endif ++ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) ++ INSTALL_PROGRAM += -s ++endif ++ ++# shared library versions, option 1 ++version=1.0.3 ++major=1 ++# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so ++#version=`ls src/.libs/lib*.so.* | \ ++# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` ++#major=`ls src/.libs/lib*.so.* | \ ++# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` ++ ++configure: configure-stamp ++configure-stamp: ++ dh_testdir ++ # Add here commands to configure the package. ++ ++ touch configure-stamp ++ ++ ++build: build-stamp ++build-stamp: configure-stamp ++ dh_testdir ++ ++ # Add here commands to compile the package. ++ $(MAKE) ++ ++ touch build-stamp ++ ++clean: ++ dh_testdir ++ dh_testroot ++ rm -f build-stamp configure-stamp ++ ++ # Add here commands to clean up after the build process. ++ -$(MAKE) distclean ++ ++ dh_clean ++ ++install: build ++ dh_testdir ++ dh_testroot ++ dh_clean -k ++ dh_installdirs ++ ++ # Add here commands to install the package into debian/ ++ $(MAKE) install_run basedir=$(CURDIR)/debian/liblockdev1/usr ++ $(MAKE) install_debug basedir=$(CURDIR)/debian/liblockdev1-dbg/usr ++ $(MAKE) install_profile basedir=$(CURDIR)/debian/liblockdev1-dbg/usr ++ $(MAKE) install_dev basedir=$(CURDIR)/debian/liblockdev1-dev/usr ++ cd LockDev && $(MAKE) pure_install $(config) PREFIX=$(CURDIR)/debian/liblockdev1-perl/usr ++ ++ mv $(CURDIR)/debian/liblockdev1-perl/usr/lib/perl5/LockDev.pm \ ++ $(CURDIR)/debian/liblockdev1-perl/usr/share/perl5 ++ ++ ln -s lockdev.3.gz \ ++ $(CURDIR)/debian/liblockdev1-dev/usr/share/man/man3/dev_lock.3.gz ++ ln -s lockdev.3.gz \ ++ $(CURDIR)/debian/liblockdev1-dev/usr/share/man/man3/dev_unlock.3.gz ++ ln -s lockdev.3.gz \ ++ $(CURDIR)/debian/liblockdev1-dev/usr/share/man/man3/dev_relock.3.gz ++ ln -s lockdev.3.gz \ ++ $(CURDIR)/debian/liblockdev1-dev/usr/share/man/man3/dev_testlock.3.gz ++ ln -s lockdev.3.gz \ ++ $(CURDIR)/debian/liblockdev1-dev/usr/share/man/man3/liblockdev.3.gz ++ ln -s liblockdev.$(version).so \ ++ $(CURDIR)/debian/liblockdev1-dev/usr/lib/liblockdev.so ++ ln -s liblockdev.$(version).so \ ++ $(CURDIR)/debian/liblockdev1/usr/lib/liblockdev.so.$(major) ++ ++ ln -s liblockdev1 \ ++ $(CURDIR)/debian/liblockdev1-dev/usr/share/doc/liblockdev1-dev ++ ln -s liblockdev1 \ ++ $(CURDIR)/debian/liblockdev1-dbg/usr/share/doc/liblockdev1-dbg ++ ++ ++# Build architecture-independent files here. ++binary-indep: build install ++# We have nothing to do by default. ++ ++# Build architecture-dependent files here. ++binary-arch: build install ++ dh_testdir ++ dh_testroot ++ dh_installchangelogs ChangeLog ++ dh_installdocs ++ rm $(CURDIR)/debian/liblockdev1-dbg/usr/share/doc/liblockdev1/c* ++# rm $(CURDIR)/debian/liblockdev1-dbg/usr/share/doc/liblockdev1/NEWS.Debia* ++ dh_installexamples ++# dh_install ++# dh_installmenu ++# dh_installdebconf ++# dh_installlogrotate ++# dh_installemacsen ++# dh_installpam ++# dh_installmime ++# dh_installinit ++# dh_installcron ++# dh_installinfo ++ dh_installman ++ dh_link ++ dh_strip -Xprofile ++ dh_compress ++ dh_fixperms ++ dh_perl ++# d_python ++ dh_makeshlibs -X usr/lib/debug -X usr/lib/profile ++ dh_installdeb ++ dh_shlibdeps ++ dh_gencontrol ++ dh_md5sums ++ dh_builddeb ++ ++binary: binary-indep binary-arch ++.PHONY: build clean binary-indep binary-arch binary install configure +--- lockdev-1.0.3.orig/debian/liblockdev1-dev.manpages ++++ lockdev-1.0.3/debian/liblockdev1-dev.manpages +@@ -0,0 +1 @@ ++docs/lockdev.3 +--- lockdev-1.0.3.orig/debian/liblockdev1-dbg.dirs ++++ lockdev-1.0.3/debian/liblockdev1-dbg.dirs +@@ -0,0 +1 @@ ++usr/share/doc/liblockdev1 +--- lockdev-1.0.3.orig/debian/control ++++ lockdev-1.0.3/debian/control +@@ -0,0 +1,55 @@ ++Source: lockdev ++Section: libs ++Priority: optional ++Maintainer: Paweł Więcek ++Uploaders: Roger Leigh ++Standards-Version: 3.6.2 ++Build-Depends: perl (>= 5.8.0-7), debhelper (>= 4.0.0) ++ ++Package: liblockdev1 ++Section: libs ++Architecture: any ++Depends: ${shlibs:Depends}, ${misc:Depends} ++Description: Run-time shared library for locking devices ++ It provides a reliable way to put an exclusive lock to ++ devices using _both_ FSSTND and SVr4 methods. ++ ++Package: liblockdev1-dev ++Section: libdevel ++Architecture: any ++Depends: liblockdev1 (= ${binary:Version}), libc6-dev, ${misc:Depends} ++Conflicts: liblockdev0-dev, liblockdev0g-dev ++Replaces: liblockdev0-dev, liblockdev0g-dev ++Description: Development library for locking devices ++ It provides a reliable way to put an exclusive lock to ++ devices using _both_ FSSTND and SVr4 methods. ++ . ++ Includes header files and static lib. ++ ++Package: liblockdev1-dbg ++Section: debug ++Priority: extra ++Architecture: any ++Depends: liblockdev1 (= ${binary:Version}), liblockdev1-dev (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} ++Conflicts: liblockdev0-dbg, liblockdev0g-dbg ++Replaces: liblockdev0-dbg, liblockdev0g-dbg ++Description: Debugging library for locking devices ++ It provides a reliable way to put an exclusive lock to ++ devices using _both_ FSSTND and SVr4 methods. ++ . ++ Includes static and shared debugging and profiling libs, ++ as well as the sources ready for use by gdb. ++ ++Package: liblockdev1-perl ++Section: perl ++Architecture: any ++Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends} ++Conflicts: liblockdev0-perl ++Replaces: liblockdev0-perl ++Description: perl extension library for locking devices ++ It provides a reliable way to put an exclusive lock to ++ devices using _both_ FSSTND and SVr4 methods. ++ . ++ Includes a shared lib loadable by perl 5 (use LockDev), ++ the module LockDev.pm and its manpage LockDev(3pm) . ++ +--- lockdev-1.0.3.orig/debian/liblockdev1-perl.dirs ++++ lockdev-1.0.3/debian/liblockdev1-perl.dirs +@@ -0,0 +1 @@ ++usr/share/perl5 +--- lockdev-1.0.3.orig/debian/liblockdev1-dev.dirs ++++ lockdev-1.0.3/debian/liblockdev1-dev.dirs +@@ -0,0 +1,2 @@ ++usr/share/man/man3 ++usr/share/doc +--- lockdev-1.0.3.orig/debian/NEWS ++++ lockdev-1.0.3/debian/NEWS +@@ -0,0 +1,8 @@ ++lockdev (1.0.3-1.1) unstable; urgency=low ++ ++ The format of device lock files has changed. ++ ++ All programs that have locked device files using the old version of ++ liblockdev needs to be restarted. ++ ++ -- Andreas Barth Mon, 27 Nov 2006 13:13:37 +0100 +--- lockdev-1.0.3.orig/debian/liblockdev1.postinst ++++ lockdev-1.0.3/debian/liblockdev1.postinst +@@ -0,0 +1,22 @@ ++#!/bin/sh -e ++ ++if [ "$1" = "configure" ] && dpkg --compare-versions "$2" lt-nl 1.0.3-1; ++then ++ echo ++ echo "WARNING" ++ echo "Format of device lock files have changed, you will need to restart all" ++ echo "programs that have locked device files using the old version of liblockdev." ++ echo ++ ++ if ls /var/lock/LCK.[0-9]* 2>/dev/null ++ then ++ echo "Right now the following programs use old lockfiles:" ++ echo ++ ps -p `cat /var/lock/LCK.[0-9]*` ++ echo ++ fi ++fi ++ ++#DEBHELPER# ++ ++exit 0 +--- lockdev-1.0.3.orig/debian/copyright ++++ lockdev-1.0.3/debian/copyright +@@ -0,0 +1,49 @@ ++liblockdev is (c) 1997, 1999 by Fabrizio Polacco ++ ++ This program is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License (LGPL) as published by the Free Software Foundation; ++ version 2.1 dated February 1999. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General ++ Public License (LGPL) along with this program; if not, write ++ to the Free Software Foundation, Inc., ++ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ ++On Debian GNU/Linux systems, the complete text of the GNU Library General ++Public License can be found in `/usr/share/common-licenses/LGPL'. ++ ++It's primary source is the Debian archives: ++ ftp://ftp.debian.org/debian/pool/main/l/lockdev/ ++ ++================ CREDITS ================ ++ ++Barak Pearlmutter ++ - code revision ++ - suggestion for the use of the semaphore. ++Juan Cespedes ++ - code revision ++Daniel Quinlan ++ - suggestion to support the cua devices. ++ - suggestions for naming of functions. ++Raphael Hertzog ++ - NMU for new perl ++Adam P. Harris ++ - changes in debian postinst. ++Martin Schulze ++ - changes in perl makefile ++ - suggestions for changes in assembler stage for debug. ++Hamish Moffatt, James Troup ++ - dependencies check. ++Yann Dirson ++ - suggestions for a debugging shared library. ++Roger Leigh ++ - updated to ISO C89 C. ++ - work with modern glibc dev_t. ++ - work with devices in subdirectories, á la DevFS ++ +--- lockdev-1.0.3.orig/src/lockdev.c ++++ lockdev-1.0.3/src/lockdev.c +@@ -125,14 +125,23 @@ + #include + #if defined (__GNU_LIBRARY__) + # include ++#ifdef __GNU__ ++# define MAJOR(dev) major (dev) ++# define MINOR(dev) minor (dev) ++#else + # define MAJOR(dev) gnu_dev_major (dev) + # define MINOR(dev) gnu_dev_minor (dev) ++#endif + #else + # error "put here a define for MAJOR and MINOR" + #endif + + #include "lockdev.h" + ++#ifndef MAXPATHLEN ++#define MAXPATHLEN 4096 ++#endif ++ + /* + * PROTOTYPES for internal functions + * all internal functions names start with _dl_