Add pkgconfig file to help building against apt-rpm (Richard Hughes)
authorPanu Matilainen <pmatilai@localhost.localdomain>
Thu, 23 Aug 2007 05:31:17 +0000 (08:31 +0300)
committerPanu Matilainen <pmatilai@localhost.localdomain>
Thu, 23 Aug 2007 05:31:17 +0000 (08:31 +0300)
apt-pkg/Makefile.am
apt-pkg/Makefile.in
apt-pkg/libapt-pkg.pc.in [new file with mode: 0644]
configure
configure.ac

index 2aa9bdc..d21b84d 100644 (file)
@@ -2,6 +2,9 @@ localedir = $(datadir)/locale
 
 lib_LTLIBRARIES = libapt-pkg.la
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libapt-pkg.pc
+
 libapt_pkg_la_LIBADD = @RPMLIBS@
 libapt_pkg_la_LDFLAGS = -version-info 3:0:0
 
@@ -159,6 +162,9 @@ $(top_builddir)/include/%: rpm/%
        @$(mkinstalldirs) $(top_builddir)/include/apt-pkg
        cp -f -p $< $@
 
+DISTCLEANFILES = libapt-pkg.pc
+EXTRA_DIST = libapt-pkg.pc.in
+
 clean-local:
        rm -f $(PRIVCOPYHEADERS)
        rm -rf $(top_builddir)/include/apt-pkg
index f8b8b44..b87fd66 100644 (file)
@@ -15,6 +15,7 @@
 @SET_MAKE@
 
 
+
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -36,7 +37,7 @@ host_triplet = @host@
 @WITH_LUA_TRUE@am__append_1 = $(top_builddir)/lua/liblua.la
 subdir = apt-pkg
 DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in
+       $(srcdir)/Makefile.in $(srcdir)/libapt-pkg.pc.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
        $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
@@ -48,14 +49,15 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/buildlib/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/include/config.h \
        $(top_builddir)/include/apt-pkg/aptconf.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = libapt-pkg.pc
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
 am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \
+       "$(DESTDIR)$(includedir)"
 libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libapt_pkg_la_DEPENDENCIES = $(am__append_1)
@@ -102,6 +104,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        $(LDFLAGS) -o $@
 SOURCES = $(libapt_pkg_la_SOURCES)
 DIST_SOURCES = $(libapt_pkg_la_SOURCES)
+pkgconfigDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgconfig_DATA)
 includeHEADERS_INSTALL = $(INSTALL_HEADER)
 HEADERS = $(include_HEADERS)
 ETAGS = etags
@@ -239,6 +243,8 @@ target_alias = @target_alias@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 lib_LTLIBRARIES = libapt-pkg.la
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libapt-pkg.pc
 libapt_pkg_la_LIBADD = @RPMLIBS@ $(am__append_1)
 libapt_pkg_la_LDFLAGS = -version-info 3:0:0
 AM_CPPFLAGS = -DLIBDIR=\"$(libdir)\" -DPKGDATADIR=\"$(pkgdatadir)\" \
@@ -372,6 +378,8 @@ COPYHEADERS = $(patsubst %.h, \
 REALOBJECTS = $(patsubst %.cc,%.lo,\
                $(filter %.cc,$(libapt_pkg_la_SOURCES)))
 
+DISTCLEANFILES = libapt-pkg.pc
+EXTRA_DIST = libapt-pkg.pc.in
 all: all-am
 
 .SUFFIXES:
@@ -405,6 +413,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+libapt-pkg.pc: $(top_builddir)/config.status $(srcdir)/libapt-pkg.pc.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
        @$(NORMAL_INSTALL)
        test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@@ -625,6 +635,23 @@ clean-libtool:
        -rm -rf .libs _libs
        -rm -rf contrib/.libs contrib/_libs
        -rm -rf rpm/.libs rpm/_libs
+install-pkgconfigDATA: $(pkgconfig_DATA)
+       @$(NORMAL_INSTALL)
+       test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
+       @list='$(pkgconfig_DATA)'; for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         f=$(am__strip_dir) \
+         echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+         $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+       done
+
+uninstall-pkgconfigDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(pkgconfig_DATA)'; for p in $$list; do \
+         f=$(am__strip_dir) \
+         echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+         rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+       done
 install-includeHEADERS: $(include_HEADERS)
        @$(NORMAL_INSTALL)
        test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@@ -719,9 +746,9 @@ distdir: $(DISTFILES)
        done
 check-am: all-am
 check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
+       for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: install-am
@@ -748,6 +775,7 @@ distclean-generic:
        -rm -f contrib/$(am__dirstamp)
        -rm -f rpm/$(DEPDIR)/$(am__dirstamp)
        -rm -f rpm/$(am__dirstamp)
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
@@ -773,7 +801,7 @@ info: info-am
 
 info-am:
 
-install-data-am: install-includeHEADERS
+install-data-am: install-includeHEADERS install-pkgconfigDATA
 
 install-dvi: install-dvi-am
 
@@ -809,7 +837,8 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
+uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+       uninstall-pkgconfigDATA
 
 .MAKE: install-am install-strip
 
@@ -821,12 +850,13 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
        install-dvi-am install-exec install-exec-am install-html \
        install-html-am install-includeHEADERS install-info \
        install-info-am install-libLTLIBRARIES install-man install-pdf \
-       install-pdf-am install-ps install-ps-am install-strip \
-       installcheck installcheck-am installdirs maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-compile \
-       mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-       tags uninstall uninstall-am uninstall-includeHEADERS \
-       uninstall-libLTLIBRARIES
+       install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+       pdf pdf-am ps ps-am tags uninstall uninstall-am \
+       uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+       uninstall-pkgconfigDATA
 
 $(REALOBJECTS): $(COPYHEADERS) $(PRIVCOPYHEADERS)
 
diff --git a/apt-pkg/libapt-pkg.pc.in b/apt-pkg/libapt-pkg.pc.in
new file mode 100644 (file)
index 0000000..9a64036
--- /dev/null
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libapt-pkg
+Description: Common library for APT
+Version: @VERSION@
+Libs: -L${libdir} -lapt-pkg
+Cflags: -I${includedir}/apt-pkg
+
index f9c8f1d..09a9930 100755 (executable)
--- a/configure
+++ b/configure
@@ -26764,7 +26764,7 @@ _ACEOF
 
 
 
-ac_config_files="$ac_config_files Makefile lua/Makefile apt-pkg/Makefile methods/Makefile cmdline/Makefile tools/Makefile doc/Makefile test/Makefile po/Makefile.in"
+ac_config_files="$ac_config_files Makefile lua/Makefile apt-pkg/Makefile apt-pkg/libapt-pkg.pc methods/Makefile cmdline/Makefile tools/Makefile doc/Makefile test/Makefile po/Makefile.in"
 
 ac_config_links="$ac_config_links include/apti18n.h:buildlib/gettext.h"
 
@@ -27458,6 +27458,7 @@ do
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "lua/Makefile") CONFIG_FILES="$CONFIG_FILES lua/Makefile" ;;
     "apt-pkg/Makefile") CONFIG_FILES="$CONFIG_FILES apt-pkg/Makefile" ;;
+    "apt-pkg/libapt-pkg.pc") CONFIG_FILES="$CONFIG_FILES apt-pkg/libapt-pkg.pc" ;;
     "methods/Makefile") CONFIG_FILES="$CONFIG_FILES methods/Makefile" ;;
     "cmdline/Makefile") CONFIG_FILES="$CONFIG_FILES cmdline/Makefile" ;;
     "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
index 37d9d7a..d279314 100644 (file)
@@ -280,6 +280,7 @@ AC_CONFIG_FILES([
          Makefile
          lua/Makefile
          apt-pkg/Makefile
+         apt-pkg/libapt-pkg.pc
          methods/Makefile
          cmdline/Makefile
          tools/Makefile