Package: libselinux Version: 1.28-2 Severity: wishlist Tags: patch Hi,
Following the patch on libsepol, I'm filing this one, similar in request (please read #348947 for more details). Patch attached. In this case I added a Depends to libsepol1-dev in libselinux1-dev, so that packages that want to link statically can do so without having to explicitely list all transitive development packages, and used the supposed to be next version where the .pc file will be included (correct apropriately otherwise). A package just Build-Depending on libselinux1-dev could use pkg-config to get the proper linker flags (either dynamic or static) from both packages. I've not changed the upstream Makefiles to use pkg-config to get the flags from libsepol, though. If you think that's worthwhile I can prepare a new patch. thanks, guillem
diff -Naur libselinux-1.28.orig/debian/control libselinux-1.28/debian/control --- libselinux-1.28.orig/debian/control 2006-01-20 01:33:14.000000000 +0200 +++ libselinux-1.28/debian/control 2006-01-20 03:59:02.000000000 +0200 @@ -42,7 +42,7 @@ Package: libselinux1-dev Architecture: any -Depends: ${shlibs:Depends}, libselinux1 (= ${Source-Version}) +Depends: ${shlibs:Depends}, libselinux1 (= ${Source-Version}), libsepol1-dev (>= 1.10-2) Section: libdevel Provides: libselinux-dev Conflicts: libselinux-dev diff -Naur libselinux-1.28.orig/debian/local.mk libselinux-1.28/debian/local.mk --- libselinux-1.28.orig/debian/local.mk 2006-01-20 01:33:14.000000000 +0200 +++ libselinux-1.28/debian/local.mk 2006-01-20 04:26:00.000000000 +0200 @@ -129,6 +129,7 @@ $(make_directory) $(LIBDIR) $(MAKE) DESTDIR=$(TMPTOP) -C src install rm -fr $(LIBDIR) + rm -fr $(TMPTOP)/usr/lib/pkgconfig rm -f $(TMPTOP)/usr/lib/libselinux.so rm -f $(TMPTOP)/usr/lib/libselinux.a chmod 0644 $(TMPTOP)/usr/lib/python2.4/site-packages/_selinux.so diff -Naur libselinux-1.28.orig/src/libselinux.pc.in libselinux-1.28/src/libselinux.pc.in --- libselinux-1.28.orig/src/libselinux.pc.in 1970-01-01 02:00:00.000000000 +0200 +++ libselinux-1.28/src/libselinux.pc.in 2006-01-20 03:55:48.000000000 +0200 @@ -0,0 +1,12 @@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ + +Name: libselinux +Description: Security Enhanced Linux library +Version: @VERSION@ +URL: http://www.nsa.gov/selinux/ +Requires.private: libsepol >= 1.10 +Libs: -L${libdir} -lselinux +Cflags: -I${includedir} + diff -Naur libselinux-1.28.orig/src/Makefile libselinux-1.28/src/Makefile --- libselinux-1.28.orig/src/Makefile 2005-11-29 17:05:36.000000000 +0200 +++ libselinux-1.28/src/Makefile 2006-01-20 03:55:48.000000000 +0200 @@ -1,5 +1,5 @@ # Installation directories. -PREFIX ?= $(DESTDIR)/usr +PREFIX ?= /usr LIBDIR ?= $(PREFIX)/lib SHLIBDIR ?= $(DESTDIR)/lib INCLUDEDIR ?= $(PREFIX)/include @@ -9,9 +9,11 @@ PYTHONLIBDIR ?= $(LIBDIR)/$(PYLIBVER) LIBVERSION = 1 +VERSION = $(shell cat ../VERSION) LIBA=libselinux.a TARGET=libselinux.so +LIBPC=libselinux.pc SWIGIF= selinuxswig.i SWIGCOUT= selinuxswig_wrap.c SWIGLOBJ:= $(patsubst %.c,%.lo,$(SWIGCOUT)) @@ -26,7 +28,7 @@ SWIG = swig -Wall -python -o $(SWIGCOUT) -outdir ./ -all: $(LIBA) $(LIBSO) $(SWIGSO) +all: $(LIBA) $(LIBSO) $(LIBPC) $(SWIGSO) $(LIBA): $(OBJS) $(AR) rcs $@ $^ @@ -42,6 +44,9 @@ $(CC) $(LDFLAGS) -shared -o $@ $^ -ldl -lsepol -L$(LIBDIR) -Wl,-soname,$(LIBSO),-z,defs ln -sf $@ $(TARGET) +$(LIBPC): $(LIBPC).in + sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; s:@libdir@:$(LIBDIR):; s:@includedir@:$(INCLUDEDIR):' < $< > $@ + %.o: %.c policy.h $(CC) $(CFLAGS) -c -o $@ $< @@ -55,19 +60,21 @@ $(SWIG) $^ install: all install-pywrap - test -d $(LIBDIR) || install -m 755 -d $(LIBDIR) - install -m 644 $(LIBA) $(LIBDIR) + test -d $(DESTDIR)$(LIBDIR) || install -m 755 -d $(DESTDIR)$(LIBDIR) + install -m 644 $(LIBA) $(DESTDIR)$(LIBDIR) + test -d $(DESTDIR)$(LIBDIR)/pkgconfig || install -m 755 -d $(DESTDIR)$(LIBDIR)/pkgconfig + install -m 644 $(LIBPC) $(DESTDIR)$(LIBDIR)/pkgconfig test -d $(SHLIBDIR) || install -m 755 -d $(SHLIBDIR) install -m 755 $(LIBSO) $(SHLIBDIR) - cd $(LIBDIR) && ln -sf ../../`basename $(SHLIBDIR)`/$(LIBSO) $(TARGET) + cd $(DESTDIR)$(LIBDIR) && ln -sf ../../`basename $(SHLIBDIR)`/$(LIBSO) $(TARGET) install-pywrap: - test -d $(PYTHONLIBDIR)/site-packages || install -m 755 -d $(PYTHONLIBDIR)/site-packages - install -m 755 $(SWIGFILES) $(PYTHONLIBDIR)/site-packages + test -d $(DESTDIR)$(PYTHONLIBDIR)/site-packages || install -m 755 -d $(DESTDIR)$(PYTHONLIBDIR)/site-packages + install -m 755 $(SWIGFILES) $(DESTDIR)$(PYTHONLIBDIR)/site-packages relabel: /sbin/restorecon $(SHLIBDIR)/$(LIBSO) clean: - -rm -f $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(SWIGLOBJ) $(SWIGSO) $(TARGET) + -rm -f $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(SWIGLOBJ) $(SWIGSO) $(TARGET) $(LIBPC)