Package: libsepol
Version: 1.10-1
Severity: wishlist
Tags: patch

Hi,

As you can see from bugs #348659 and #347744 dpkg is now FTBFS, that's
due to libselinux having gained the libsepol dependency, and there not
being a way for packages to know automatically the transitive dependencies
when statically linking.

So I'd like you to include the attached patch, which generates a .pc
file to be used with pkg-config. I'm sending a similar report for
libselinux to be able to do something like:

  pkg-config --static --libs libselinux

We are planning to upload dpkg Thursday January, 26th, and probably
having a mini-freeze on Sunday January, 22th. So I'd like to know if
you could upload new packages with those fixes by that time. If you
have concerns, for example at how upstream may want to name the .pc
file itself and don't want to create divergence or want to think
calmly about this request or cannot upload by then, please tell me and
I'll use a temporary workaround in dpkg in the meantime.

thanks,
guillem
diff -Naur libsepol-1.10.orig/debian/local.mk libsepol-1.10/debian/local.mk
--- libsepol-1.10.orig/debian/local.mk  2006-01-20 01:27:58.000000000 +0200
+++ libsepol-1.10/debian/local.mk       2006-01-20 01:28:11.000000000 +0200
@@ -69,6 +69,7 @@
        $(MAKE)             DESTDIR=$(TMPTOP) -C src install
        rm -f               $(LIBDIR)/libsepol.a
        rm -f               $(LIBDIR)/libsepol.so
+       rm -f               $(LIBDIR)/libsepol.pc
        rm -rf              $(TMPTOP)/usr/lib
        chmod 0644          $(LIBDIR)/libsepol.so.1
        $(install_file)     debian/changelog         $(DOCDIR)/changelog.Debian
diff -Naur libsepol-1.10.orig/src/libsepol.pc.in 
libsepol-1.10/src/libsepol.pc.in
--- libsepol-1.10.orig/src/libsepol.pc.in       1970-01-01 02:00:00.000000000 
+0200
+++ libsepol-1.10/src/libsepol.pc.in    2006-01-20 01:28:11.000000000 +0200
@@ -0,0 +1,11 @@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+
+Name: libsepol
+Description: Security Enhanced Linux policy library
+Version: @VERSION@
+URL: http://www.nsa.gov/selinux/
+Libs: -L${libdir} -lsepol
+Cflags: -I${includedir}
+
diff -Naur libsepol-1.10.orig/src/Makefile libsepol-1.10/src/Makefile
--- libsepol-1.10.orig/src/Makefile     2005-11-02 01:07:14.000000000 +0200
+++ libsepol-1.10/src/Makefile  2006-01-20 01:35:13.000000000 +0200
@@ -1,19 +1,22 @@
 # Installation directories.
-PREFIX ?= $(DESTDIR)/usr
+PREFIX ?= /usr
+INCDIR ?= $(PREFIX)/include
 LIBDIR ?= $(PREFIX)/lib
 SHLIBDIR ?= $(DESTDIR)/lib
 
+VERSION = $(shell cat ../VERSION)
 LIBVERSION = 1
 
 LIBA=libsepol.a 
 TARGET=libsepol.so
+LIBPC=libsepol.pc
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(wildcard *.c))
 LOBJS= $(patsubst %.c,%.lo,$(wildcard *.c))
 CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
 override CFLAGS += -I. -I../include -D_GNU_SOURCE
 
-all: $(LIBA) $(LIBSO)
+all: $(LIBA) $(LIBSO) $(LIBPC)
 
 $(LIBA):  $(OBJS)
        $(AR) rcs $@ $^
@@ -23,6 +26,9 @@
        $(CC) $(LDFLAGS) -shared -o $@ $^ 
-Wl,-soname,$(LIBSO),--version-script=libsepol.map,-z,defs
        ln -sf $@ $(TARGET) 
 
+$(LIBPC): $(LIBPC).in
+       sed -e 's/@VERSION@/$(VERSION)/; s:@prefix@:$(PREFIX):; 
s:@libdir@:$(LIBDIR):; s:@includedir@:$(INCDIR):' < $< > $@
+
 %.o:  %.c 
        $(CC) $(CFLAGS) -c -o $@ $<
 
@@ -30,15 +36,17 @@
        $(CC) $(CFLAGS) -fpic -DSHARED -c -o $@ $<
 
 install: all
-       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)
 
 relabel:
        /sbin/restorecon $(SHLIBDIR)/$(LIBSO)
 
 clean: 
-       -rm -f $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(TARGET) 
+       -rm -f $(OBJS) $(LOBJS) $(LIBA) $(LIBSO) $(TARGET) $(LIBPC)
 

Reply via email to