Pārlūkot izejas kodu

Move libraries to subdirectories under lib/

This will allow to use the same include path than the future system
one, for example “#include <dpkg/dpkg.h>”. It also unclutters the source
topdir.
Guillem Jover 17 gadi atpakaļ
vecāks
revīzija
01d05324e0
75 mainītis faili ar 89 papildinājumiem un 73 dzēšanām
  1. 0 1
      Makefile.am
  2. 4 3
      configure.ac
  3. 4 3
      dpkg-deb/Makefile.am
  4. 4 3
      dpkg-split/Makefile.am
  5. 4 3
      dselect/Makefile.am
  6. 3 48
      lib/Makefile.am
  7. 1 1
      libcompat/Makefile.am
  8. 0 0
      lib/compat/alphasort.c
  9. 0 0
      lib/compat/compat.h
  10. 0 0
      lib/compat/getopt.c
  11. 0 0
      lib/compat/getopt.h
  12. 0 0
      lib/compat/getopt1.c
  13. 0 0
      lib/compat/gettext.h
  14. 0 0
      lib/compat/obstack.c
  15. 0 0
      lib/compat/obstack.h
  16. 0 0
      lib/compat/scandir.c
  17. 0 0
      lib/compat/snprintf.c
  18. 0 0
      lib/compat/strerror.c
  19. 0 0
      lib/compat/strnlen.c
  20. 0 0
      lib/compat/strnlen.h
  21. 0 0
      lib/compat/strsignal.c
  22. 0 0
      lib/compat/unsetenv.c
  23. 0 0
      lib/compat/vsnprintf.c
  24. 0 0
      lib/dpkg/.gitignore
  25. 52 0
      lib/dpkg/Makefile.am
  26. 0 0
      lib/dpkg/cleanup.c
  27. 0 0
      lib/dpkg/compression.c
  28. 0 0
      lib/dpkg/database.c
  29. 0 0
      lib/dpkg/dbmodify.c
  30. 0 0
      lib/dpkg/dlist.h
  31. 0 0
      lib/dpkg/dpkg-db.h
  32. 0 0
      lib/dpkg/dpkg-def.h
  33. 0 0
      lib/dpkg/dpkg-i18n.h
  34. 0 0
      lib/dpkg/dpkg-priv.h
  35. 0 0
      lib/dpkg/dpkg-test.h
  36. 0 0
      lib/dpkg/dpkg.h
  37. 0 0
      lib/dpkg/dump.c
  38. 0 0
      lib/dpkg/ehandle.c
  39. 0 0
      lib/dpkg/fields.c
  40. 0 0
      lib/dpkg/lock.c
  41. 0 0
      lib/dpkg/log.c
  42. 0 0
      lib/dpkg/md5.c
  43. 0 0
      lib/dpkg/md5.h
  44. 0 0
      lib/dpkg/mlib.c
  45. 0 0
      lib/dpkg/myopt-util.c
  46. 0 0
      lib/dpkg/myopt.c
  47. 0 0
      lib/dpkg/myopt.h
  48. 0 0
      lib/dpkg/nfmalloc.c
  49. 0 0
      lib/dpkg/parse.c
  50. 0 0
      lib/dpkg/parsedump.h
  51. 0 0
      lib/dpkg/parsehelp.c
  52. 0 0
      lib/dpkg/path.c
  53. 0 0
      lib/dpkg/progress.c
  54. 0 0
      lib/dpkg/progress.h
  55. 0 0
      lib/dpkg/showpkg.c
  56. 0 0
      lib/dpkg/string.c
  57. 0 0
      lib/dpkg/subproc.c
  58. 0 0
      lib/dpkg/tarfn.c
  59. 0 0
      lib/dpkg/tarfn.h
  60. 0 0
      lib/dpkg/test/.gitignore
  61. 2 1
      lib/test/Makefile.am
  62. 0 0
      lib/dpkg/test/t-macros.c
  63. 0 0
      lib/dpkg/test/t-path.c
  64. 0 0
      lib/dpkg/test/t-pkginfo.c
  65. 0 0
      lib/dpkg/test/t-string.c
  66. 0 0
      lib/dpkg/test/t-test.c
  67. 0 0
      lib/dpkg/test/t-varbuf.c
  68. 0 0
      lib/dpkg/test/t-version.c
  69. 0 0
      lib/dpkg/trigdeferred.l
  70. 0 0
      lib/dpkg/triglib.c
  71. 0 0
      lib/dpkg/utils.c
  72. 0 0
      lib/dpkg/varbuf.c
  73. 0 0
      lib/dpkg/vercmp.c
  74. 8 7
      src/Makefile.am
  75. 7 3
      utils/Makefile.am

+ 0 - 1
Makefile.am

@@ -5,7 +5,6 @@ if WITH_DSELECT
 endif
 
 SUBDIRS = \
-	libcompat \
 	lib \
 	src \
 	$(MAYBE_DSELECT) \

+ 4 - 3
configure.ac

@@ -2,7 +2,7 @@
 
 AC_PREREQ(2.59)
 AC_INIT([dpkg], [1.15.4~], [debian-dpkg@lists.debian.org])
-AC_CONFIG_SRCDIR([lib/dpkg.h])
+AC_CONFIG_SRCDIR([lib/dpkg/dpkg.h])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([config])
 
@@ -109,9 +109,10 @@ AC_CONFIG_FILES([ Makefile
 		  dselect/Makefile
 		  dselect/methods/Makefile
 		  dselect/po/Makefile.in
-		  libcompat/Makefile
 		  lib/Makefile
-		  lib/test/Makefile
+		  lib/compat/Makefile
+		  lib/dpkg/Makefile
+		  lib/dpkg/test/Makefile
 		  man/Makefile
 		  po/Makefile.in
 		  scripts/Makefile

+ 4 - 3
dpkg-deb/Makefile.am

@@ -3,7 +3,8 @@
 localedir = $(datadir)/locale
 INCLUDES = \
 	-DLOCALEDIR=\"$(localedir)\" \
-	-idirafter $(top_srcdir)/libcompat \
+	-idirafter $(top_srcdir)/lib/compat \
+	-I$(top_srcdir)/lib/dpkg \
 	-I$(top_srcdir)/lib
 
 
@@ -17,8 +18,8 @@ dpkg_deb_SOURCES = \
 	main.c
 
 dpkg_deb_LDADD = \
-	../lib/libdpkg.a \
-	../libcompat/libcompat.a \
+	../lib/dpkg/libdpkg.a \
+	../lib/compat/libcompat.a \
 	$(LIBINTL) \
 	$(ZLIB_LIBS) \
 	$(BZ2_LIBS) \

+ 4 - 3
dpkg-split/Makefile.am

@@ -4,7 +4,8 @@ localedir = $(datadir)/locale
 INCLUDES = \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-DADMINDIR=\"$(admindir)\" -DMKSPLITSCRIPT=\"$(pkglibdir)/mksplit\" \
-	-idirafter $(top_srcdir)/libcompat \
+	-idirafter $(top_srcdir)/lib/compat \
+	-I$(top_srcdir)/lib/dpkg \
 	-I$(top_srcdir)/lib
 
 
@@ -19,8 +20,8 @@ dpkg_split_SOURCES = \
 	split.c
 
 dpkg_split_LDADD = \
-	../lib/libdpkg.a \
-	../libcompat/libcompat.a \
+	../lib/dpkg/libdpkg.a \
+	../lib/compat/libcompat.a \
 	$(LIBINTL)
 
 

+ 4 - 3
dselect/Makefile.am

@@ -7,7 +7,8 @@ INCLUDES = \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-DADMINDIR=\"$(admindir)\" -DLIBDIR=\"$(pkglibdir)\" \
 	-DLOCALLIBDIR=\"/usr/local/lib/dpkg\" \
-	-idirafter $(top_srcdir)/libcompat \
+	-idirafter $(top_srcdir)/lib/compat \
+	-I$(top_srcdir)/lib/dpkg \
 	-I$(top_srcdir)/lib
 
 
@@ -38,8 +39,8 @@ dselect_SOURCES = \
 
 dselect_LDADD = \
 	$(CURSES_LIBS) \
-	../lib/libdpkg.a \
-	../libcompat/libcompat.a \
+	../lib/dpkg/libdpkg.a \
+	../lib/compat/libcompat.a \
 	$(LIBINTL)
 
 

+ 3 - 48
lib/Makefile.am

@@ -1,51 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = test
+SUBDIRS = \
+	compat \
+	dpkg
 
-localedir = $(datadir)/locale
-pkgconfdir = $(sysconfdir)/@PACKAGE@
-INCLUDES = \
-	-DLOCALEDIR=\"$(localedir)\" \
-	-DCONFIGDIR=\"$(pkgconfdir)\" \
-	-DCOPYINGFILE=\"$(datadir)/common-licenses/GPL-2\" \
-	-idirafter $(top_srcdir)/libcompat
-
-
-noinst_LIBRARIES = libdpkg.a
-
-libdpkg_a_SOURCES = \
-	dpkg-def.h \
-	dpkg.h \
-	dpkg-i18n.h \
-	dpkg-db.h \
-	dpkg-priv.h \
-	dpkg-test.h \
-	dlist.h \
-	cleanup.c \
-	compression.c \
-	database.c \
-	dbmodify.c \
-	dump.c \
-	ehandle.c \
-	fields.c \
-	lock.c \
-	log.c \
-	md5.c md5.h \
-	mlib.c \
-	myopt.c myopt.h \
-	myopt-util.c \
-	nfmalloc.c \
-	parse.c \
-	parsehelp.c \
-	parsedump.h \
-	path.c \
-	progress.c progress.h \
-	showpkg.c \
-	string.c \
-	subproc.c \
-	tarfn.c tarfn.h \
-	triglib.c \
-	trigdeferred.l \
-	utils.c \
-	varbuf.c \
-	vercmp.c

+ 1 - 1
libcompat/Makefile.am

@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 INCLUDES = \
-	-idirafter $(top_srcdir)/libcompat
+	-idirafter $(top_srcdir)/lib/compat
 
 
 noinst_LIBRARIES = libcompat.a

libcompat/alphasort.c → lib/compat/alphasort.c


libcompat/compat.h → lib/compat/compat.h


libcompat/getopt.c → lib/compat/getopt.c


libcompat/getopt.h → lib/compat/getopt.h


libcompat/getopt1.c → lib/compat/getopt1.c


libcompat/gettext.h → lib/compat/gettext.h


libcompat/obstack.c → lib/compat/obstack.c


libcompat/obstack.h → lib/compat/obstack.h


libcompat/scandir.c → lib/compat/scandir.c


libcompat/snprintf.c → lib/compat/snprintf.c


libcompat/strerror.c → lib/compat/strerror.c


libcompat/strnlen.c → lib/compat/strnlen.c


libcompat/strnlen.h → lib/compat/strnlen.h


libcompat/strsignal.c → lib/compat/strsignal.c


libcompat/unsetenv.c → lib/compat/unsetenv.c


libcompat/vsnprintf.c → lib/compat/vsnprintf.c


lib/.gitignore → lib/dpkg/.gitignore


+ 52 - 0
lib/dpkg/Makefile.am

@@ -0,0 +1,52 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = test
+
+localedir = $(datadir)/locale
+pkgconfdir = $(sysconfdir)/@PACKAGE@
+INCLUDES = \
+	-DLOCALEDIR=\"$(localedir)\" \
+	-DCONFIGDIR=\"$(pkgconfdir)\" \
+	-DCOPYINGFILE=\"$(datadir)/common-licenses/GPL-2\" \
+	-idirafter $(top_srcdir)/lib/compat \
+	-I$(top_srcdir)/lib
+
+
+noinst_LIBRARIES = libdpkg.a
+
+libdpkg_a_SOURCES = \
+	dpkg-def.h \
+	dpkg.h \
+	dpkg-i18n.h \
+	dpkg-db.h \
+	dpkg-priv.h \
+	dpkg-test.h \
+	dlist.h \
+	cleanup.c \
+	compression.c \
+	database.c \
+	dbmodify.c \
+	dump.c \
+	ehandle.c \
+	fields.c \
+	lock.c \
+	log.c \
+	md5.c md5.h \
+	mlib.c \
+	myopt.c myopt.h \
+	myopt-util.c \
+	nfmalloc.c \
+	parse.c \
+	parsehelp.c \
+	parsedump.h \
+	path.c \
+	progress.c progress.h \
+	showpkg.c \
+	string.c \
+	subproc.c \
+	tarfn.c tarfn.h \
+	triglib.c \
+	trigdeferred.l \
+	utils.c \
+	varbuf.c \
+	vercmp.c

lib/cleanup.c → lib/dpkg/cleanup.c


lib/compression.c → lib/dpkg/compression.c


lib/database.c → lib/dpkg/database.c


lib/dbmodify.c → lib/dpkg/dbmodify.c


lib/dlist.h → lib/dpkg/dlist.h


lib/dpkg-db.h → lib/dpkg/dpkg-db.h


lib/dpkg-def.h → lib/dpkg/dpkg-def.h


lib/dpkg-i18n.h → lib/dpkg/dpkg-i18n.h


lib/dpkg-priv.h → lib/dpkg/dpkg-priv.h


lib/dpkg-test.h → lib/dpkg/dpkg-test.h


lib/dpkg.h → lib/dpkg/dpkg.h


lib/dump.c → lib/dpkg/dump.c


lib/ehandle.c → lib/dpkg/ehandle.c


lib/fields.c → lib/dpkg/fields.c


lib/lock.c → lib/dpkg/lock.c


lib/log.c → lib/dpkg/log.c


lib/md5.c → lib/dpkg/md5.c


lib/md5.h → lib/dpkg/md5.h


lib/mlib.c → lib/dpkg/mlib.c


lib/myopt-util.c → lib/dpkg/myopt-util.c


lib/myopt.c → lib/dpkg/myopt.c


lib/myopt.h → lib/dpkg/myopt.h


lib/nfmalloc.c → lib/dpkg/nfmalloc.c


lib/parse.c → lib/dpkg/parse.c


lib/parsedump.h → lib/dpkg/parsedump.h


lib/parsehelp.c → lib/dpkg/parsehelp.c


lib/path.c → lib/dpkg/path.c


lib/progress.c → lib/dpkg/progress.c


lib/progress.h → lib/dpkg/progress.h


lib/showpkg.c → lib/dpkg/showpkg.c


lib/string.c → lib/dpkg/string.c


lib/subproc.c → lib/dpkg/subproc.c


lib/tarfn.c → lib/dpkg/tarfn.c


lib/tarfn.h → lib/dpkg/tarfn.h


lib/test/.gitignore → lib/dpkg/test/.gitignore


+ 2 - 1
lib/test/Makefile.am

@@ -1,7 +1,8 @@
 ## Process this file with automake to produce Makefile.in
 
 INCLUDES = \
-	-idirafter $(top_srcdir)/libcompat \
+	-idirafter $(top_srcdir)/lib/compat \
+	-I$(top_srcdir)/lib/dpkg \
 	-I$(top_srcdir)/lib
 
 

lib/test/t-macros.c → lib/dpkg/test/t-macros.c


lib/test/t-path.c → lib/dpkg/test/t-path.c


lib/test/t-pkginfo.c → lib/dpkg/test/t-pkginfo.c


lib/test/t-string.c → lib/dpkg/test/t-string.c


lib/test/t-test.c → lib/dpkg/test/t-test.c


lib/test/t-varbuf.c → lib/dpkg/test/t-varbuf.c


lib/test/t-version.c → lib/dpkg/test/t-version.c


lib/trigdeferred.l → lib/dpkg/trigdeferred.l


lib/triglib.c → lib/dpkg/triglib.c


lib/utils.c → lib/dpkg/utils.c


lib/varbuf.c → lib/dpkg/varbuf.c


lib/vercmp.c → lib/dpkg/vercmp.c


+ 8 - 7
src/Makefile.am

@@ -4,7 +4,8 @@ localedir = $(datadir)/locale
 INCLUDES = \
 	-DLOCALEDIR=\"$(localedir)\" \
 	-DADMINDIR=\"$(admindir)\" \
-	-idirafter $(top_srcdir)/libcompat \
+	-idirafter $(top_srcdir)/lib/compat \
+	-I$(top_srcdir)/lib/dpkg \
 	-I$(top_srcdir)/lib
 
 
@@ -32,8 +33,8 @@ dpkg_SOURCES = \
 	update.c
 
 dpkg_LDADD = \
-	../lib/libdpkg.a \
-	../libcompat/libcompat.a \
+	../lib/dpkg/libdpkg.a \
+	../lib/compat/libcompat.a \
 	$(LIBINTL) \
 	$(ZLIB_LIBS) \
 	$(BZ2_LIBS) \
@@ -47,16 +48,16 @@ dpkg_query_SOURCES = \
 	query.c
 
 dpkg_query_LDADD = \
-	../lib/libdpkg.a \
-	../libcompat/libcompat.a \
+	../lib/dpkg/libdpkg.a \
+	../lib/compat/libcompat.a \
 	$(LIBINTL)
 
 dpkg_trigger_SOURCES = \
 	trigcmd.c
 
 dpkg_trigger_LDADD = \
-	../lib/libdpkg.a \
-	../libcompat/libcompat.a \
+	../lib/dpkg/libdpkg.a \
+	../lib/compat/libcompat.a \
 	$(LIBINTL)
 
 install-data-local:

+ 7 - 3
utils/Makefile.am

@@ -3,7 +3,8 @@
 localedir = $(datadir)/locale
 INCLUDES = \
 	-DLOCALEDIR=\"$(localedir)\" \
-	-idirafter $(top_srcdir)/libcompat \
+	-idirafter $(top_srcdir)/lib/compat \
+	-I$(top_srcdir)/lib/dpkg \
 	-I$(top_srcdir)/lib
 
 sbin_PROGRAMS =
@@ -14,7 +15,9 @@ if WITH_START_STOP_DAEMON
   start_stop_daemon_SOURCES = \
 	start-stop-daemon.c
 
-  start_stop_daemon_LDADD = ../libcompat/libcompat.a $(SSD_LIBS)
+  start_stop_daemon_LDADD = \
+	../lib/compat/libcompat.a \
+	$(SSD_LIBS)
 endif
 
 sbin_PROGRAMS += dpkg-install-info
@@ -22,7 +25,8 @@ sbin_PROGRAMS += dpkg-install-info
 # Automake has its own install-info rule, gah
 dpkg_install_info_SOURCES = install-info.c
 
-dpkg_install_info_LDADD = ../libcompat/libcompat.a
+dpkg_install_info_LDADD = \
+	../lib/compat/libcompat.a
 
 transform = s/dpkg-install-info/install-info/; $(program_transform_name)