From a1526a3e7dda31e236985ab465a5befa298eef26 Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Mon, 17 Oct 2005 18:52:43 +0000 Subject: added first part of the autoconf stuff - patch from Christian Hamar --- ChangeLog | 27 +++++++++ Makefile.am | 8 +++ TODO.autoconf | 39 +++++++++++++ autoclean.sh | 30 ++++++++++ autogen.sh | 8 +++ config.h | 5 -- configure.in | 149 ++++++++++++++++++++++++++++++++++++++++++++++++ doc/Makefile.am | 26 +++++++++ lib/libalpm/Makefile | 40 ------------- lib/libalpm/Makefile.am | 31 ++++++++++ lib/libalpm/alpm.h | 2 +- lib/libftp/Makefile | 62 -------------------- lib/libftp/Makefile.am | 17 ++++++ scripts/Makefile.am | 2 + src/pacman/Makefile | 41 ------------- src/pacman/Makefile.am | 20 +++++++ src/pacman/pacman.c | 2 +- src/util/Makefile.am | 11 ++++ 18 files changed, 370 insertions(+), 150 deletions(-) create mode 100644 Makefile.am create mode 100644 TODO.autoconf create mode 100755 autoclean.sh create mode 100755 autogen.sh delete mode 100644 config.h create mode 100644 configure.in create mode 100644 doc/Makefile.am delete mode 100644 lib/libalpm/Makefile create mode 100644 lib/libalpm/Makefile.am delete mode 100644 lib/libftp/Makefile create mode 100644 lib/libftp/Makefile.am create mode 100644 scripts/Makefile.am delete mode 100644 src/pacman/Makefile create mode 100644 src/pacman/Makefile.am create mode 100644 src/util/Makefile.am diff --git a/ChangeLog b/ChangeLog index c6b9e42d..3ce748b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,32 @@ VERSION DESCRIPTION ----------------------------------------------------------------------------- + - fix for regex searches with -Ss (Miklos Vanja) +2.9.7 - fixed the dupe listings of packages when dealing w/ groups + - patches from Miklos Vanja: + - add regexp search support for -Qs and -Ss + - fixed md5sums on x86_64 + - add --sudosync to makepkg + - show syntax help if an invalid option is used + - added makepkg option to disable ccache support + - changed license field to operate as an array, not a string + - added more logic for file conflict checks - if one target + is a file and the other is a directory, then it's a conflict + - fixed the integrity check in pacman-optimize + - reverted NoUpgrade to old behaviour and instead, added the + NoExtract directive to pacman.conf, which prevents a file + from ever being extracted on to the system + eg, NoExtract = home/httpd/html/index.html +2.9.6 - added a pacman-optimize script to try and defragment the DB + - modified NoUpgrade behaviour to avoid extracting files + that are missing from the filesystem -- this helps in + situations where the admin does not want the file there, eg, + remove index.html so index.php takes precedence + - fixed a bug where files would sometimes go missing if they + moved from one package to another + - add db_remove() which is responsible for clearing out stale + hash table entries when packages are removed + - added ccache support to makepkg + - patch from Aurelien Foret fixes a few memory leaks 2.9.5 - bugfix: missing files after re-ordering packages wrt deps with --upgrade - added "Repository" line to -Si output diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..44523442 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,8 @@ +SUBDIRS = lib/libftp lib/libalpm src/util src/pacman scripts doc + +EXTRA_DIST = \ + ChangeLog \ + COPYING \ + README \ + TODO \ + TODO.autoconf diff --git a/TODO.autoconf b/TODO.autoconf new file mode 100644 index 00000000..9ab29652 --- /dev/null +++ b/TODO.autoconf @@ -0,0 +1,39 @@ +TODO for autoconf/automake: + +pacman's Makefile.am and configure.in +===================================== + +- find out how can we prevent automake/autoconf to build pacman.static binary, if we + are configured using --disable-static flag. Now if builded with this option, then pacman.static + compile fails, because there will be no libalpm.a (just .so) + +global +====== + +- review autoclean.sh script. Maybe there is a more simple way to do this FULL clean. + +- Add i18n (gettext) support to configure.in and create the 'po' directory (half ready) -krix + +- Add doxygen support to configure.in to generate code documentation automatically + +- Add libarchive depends instead of libtar. libtar isn't developed, but libarchive is. + libarchive is a powerfuller thing than libtar and not much bigger. It supports many + archive formats, eg .tar.gz, .tar.bz2, zip, etc.. + +- Many things :)) If you got idea or request, then implement it. + +libalpm and codechanges +======================= + +- Add much more defines in configure.in via options or not. Like CACHEDIR, PKGEXT, etc. + Those will be available from config.h so not need a big codechange. But it is usefull. + The user can specify at the configure what cachedir or pkgext he/she want. And maybe better + for other distros (like frugalware :) ) which are using other PKGEXT or cachedir than default. + +- Review what needed to be in config.h and what not. Probably many #depends which are now hardcoded + into the sources. + + +Christian Hamar alias krix + +2005. oct. 13., wed, 22.38.32 CEST diff --git a/autoclean.sh b/autoclean.sh new file mode 100755 index 00000000..a3d16104 --- /dev/null +++ b/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh -xu + +make distclean +rm -rf autom4te.cache +rm -rf Makefile +rm -rf Makefile.in +rm -rf configure +rm -rf config.* +rm -rf stamp* +rm -rf depcomp +rm -rf install-sh +rm -rf missing +rm -rf src/pacman/Makefile +rm -rf src/pacman/Makefile.in +rm -rf src/util/Makefile +rm -rf src/util/Makefile.in +rm -rf lib/libftp/Makefile +rm -rf lib/libftp/Makefile.in +rm -rf lib/libalpm/Makefile.in +rm -rf lib/libalpm/Makefile +rm -rf aclocal.m4 +rm -rf ltmain.sh +rm -rf doc/Makefile +rm -rf doc/Makefile.in +rm -rf doc/html/* +rm -rf doc/*.8 +rm -rf compile +rm -rf libtool +rm -rf scripts/.deps/ +rm -rf scripts/Makefile.in diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 00000000..7d6a5ace --- /dev/null +++ b/autogen.sh @@ -0,0 +1,8 @@ +#!/bin/sh -exu + +#intltoolize -f -c +libtoolize -f -c +aclocal --force +autoheader -f +autoconf -f +automake -a -c --gnu --foreign diff --git a/config.h b/config.h deleted file mode 100644 index e59a0e58..00000000 --- a/config.h +++ /dev/null @@ -1,5 +0,0 @@ -#define ENABLE_NLS 1 -#define HAVE_LOCALE_H 1 -#define HAVE_SETLOCALE 1 -#define HAVE_STRVERSCMP 1 -#undef CYGWIN diff --git a/configure.in b/configure.in new file mode 100644 index 00000000..4c3e6ebd --- /dev/null +++ b/configure.in @@ -0,0 +1,149 @@ +ENV_CFLAGS=$CFLAGS + +AC_PREREQ(2.59) +AC_INIT([Pacman package manager], 0.9.5, [bugreport@somemail.org], pacman) +AC_LANG(C) +AM_CONFIG_HEADER(config.h) +AC_CANONICAL_SYSTEM +AM_INIT_AUTOMAKE + +dnl Define here the libalpm version number +PM_MAJOR_VERSION=0 +PM_MINOR_VERSION=1 +PM_MICRO_VERSION=0 +PM_VERSION=$PM_MAJOR_VERSION.$PM_MINOR_VERSION.$PM_MICRO_VERSION$PM_MICRO_VERSION_SUFFIX +dnl Needed for libtool to create proper shared lib version +PM_VERSION_INFO=`expr $PM_MAJOR_VERSION + $PM_MINOR_VERSION`:$PM_MICRO_VERSION:$PM_MINOR_VERSION + +AC_SUBST(PM_MAJOR_VERSION) +AC_SUBST(PM_MINOR_VERSION) +AC_SUBST(PM_MICRO_VERSION) +AC_SUBST(PM_VERSION) +AC_SUBST(PM_VERSION_INFO) + +dnl Define here the pacman binary program version number +PACMAN_VERSION=0.9.5 +AC_SUBST(PACMAN_VERSION) + +dnl Put out version numbers to config.h +AC_DEFINE_UNQUOTED([PM_VERSION], ["$PM_VERSION"], [libalpm version number]) +AC_DEFINE_UNQUOTED([PACMAN_VERSION], ["$PACMAN_VERSION"], [pacman version number]) + +AC_PROG_CC +AC_HEADER_STDC +AC_PROG_INSTALL +AC_CHECK_FUNCS([strverscmp]) +AM_PROG_LIBTOOL + +dnl Help line for man2html +AC_ARG_ENABLE(man2html, + AC_HELP_STRING([--enable-man2html], [Build html docs via man2html]), + [wantman2html=$enableval], [wantman2html=no]) + +dnl Help line for more-warnings +AC_ARG_ENABLE(more-warnings, + AC_HELP_STRING([--disable-more-warnings], [Minimum compiler warnings]), + [set_more_warnings="${enableval}"], [warnings_default=yes]) + +dnl Help line for debug +AC_ARG_ENABLE(debug, + AC_HELP_STRING([--disable-debug], [Disable debugging support]), + [debug=$enableval], [debug=yes]) + +dnl Check for man2html binary +AC_MSG_CHECKING(for support man2html) +if test x$wantman2html = xyes ; then + AC_CHECK_PROGS([MAN2HTML], [man2html] [man2html prog]) + AM_CONDITIONAL(HAS_MAN2HTML, test $MAN2HTML) + if test $MAN2HTML ; then + AC_DEFINE([HAS_MAN2HTML], [TRUE], [Enabled HTML generation from man via man2html]) + AC_MSG_RESULT(yes) + else + AC_DEFINE([HAS_MAN2HTML], [FALSE], [Disabled HTML generation from man via man2html]) + AC_MSG_RESULT(no, man2html missing) + fi +else + AM_CONDITIONAL(HAS_MAN2HTML, test $MAN2HTML) + AC_DEFINE([HAS_MAN2HTML], [FALSE], [Not specified at configure line]) + AC_MSG_RESULT(not requested by configure) +fi + +dnl Enable or disable Warning FLAGS during compile +AC_MSG_CHECKING(for more compiler warnings) +if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then + AC_MSG_RESULT(yes) + CFLAGS="-Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes \ + -Wnested-externs -Wsign-compare" + for option in -Wno-sign-compare; do + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $option" + AC_MSG_CHECKING([whether gcc understands $option]) + AC_TRY_COMPILE([], [], + has_option=yes, + has_option=no,) + if test $has_option = no; then + CFLAGS="$SAVE_CFLAGS" + fi + AC_MSG_RESULT($has_option) + unset has_option + unset SAVE_CFLAGS + done + unset option +else + AC_MSG_RESULT(no) + unset CFLAGS +fi + +dnl Enable or disable debug code (-g) +AC_MSG_CHECKING(for debug mode request) +if test x$debug = xyes ; then + AC_DEFINE([PACMAN_DEBUG], [TRUE], [Enable debugging support]) + AM_CONDITIONAL(PACMAN_DEBUG, test x$debug = xyes) + CFLAGS="$CFLAGS -g" + AC_MSG_RESULT(yes) +else + AC_DEFINE([PACMAN_DEBUG], [FALSE], [Disable debugging support]) + if test -z "$ENV_CFLAGS"; then + ENV_CFLAGS="-O2" + fi + AC_MSG_RESULT(no) +fi + +dnl Check for zlib +AC_CHECK_LIB([z], [gzsetparams], [AC_CHECK_HEADER([zlib.h], [LIBZ='-lz'])]) +if test -n "$LIBZ"; then + LDFLAGS="$LDFLAGS $LIBZ" +fi + +dnl Check for libtar +AC_CHECK_LIB([tar], [tar_open], [AC_CHECK_HEADER([libtar.h], [LIBTAR='-ltar'])]) +if test -n "$LIBTAR"; then + CFLAGS="$CFLAGS" + LDFLAGS="$LDFLAGS $LIBTAR" +fi + +CFLAGS="$CFLAGS $ENV_CFLAGS" + +dnl ========================================================================== + +AC_OUTPUT([ +lib/libalpm/Makefile +lib/libftp/Makefile +src/pacman/Makefile +src/util/Makefile +scripts/Makefile +doc/Makefile +Makefile +]) + +echo " +pacman-$VERSION: + + prefix: ${prefix} + source code location: ${srcdir} + compiler: ${CC} + compiler flags: ${CFLAGS} + libalpm version: ${PM_VERSION} + + debug support: ${debug} +" diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 00000000..5e9e159f --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,26 @@ +all: makepkg.8 pacman.8 + +if HAS_MAN2HTML +makepkg.8: + sed -e 's,#PACMAN_VERSION#,$(PACMAN_VERSION),g' < makepkg.8.in > makepkg.8 + man2html makepkg.8 > html/makepkg.8.html +else +makepkg.8: + sed -e 's,#PACMAN_VERSION#,$(PACMAN_VERSION),g' < makepkg.8.in > makepkg.8 +endif + +if HAS_MAN2HTML +pacman.8: + sed -e 's,#PACMAN_VERSION#,$(PACMAN_VERSION),g' < pacman.8.in > pacman.8 + man2html pacman.8 > html/pacman.8.html +else +pacman.8: + sed -e 's,#PACMAN_VERSION#,$(PACMAN_VERSION),g' < pacman.8.in > pacman.8 +endif + +clean: + rm -rf *.8 + rm -rf html/* + +man_MANS: pacman.8 makepkg.8 +EXTRA_DIST = $(man_MANS) diff --git a/lib/libalpm/Makefile b/lib/libalpm/Makefile deleted file mode 100644 index 1f021776..00000000 --- a/lib/libalpm/Makefile +++ /dev/null @@ -1,40 +0,0 @@ - -CXX=gcc -CFLAGS=-g -Wall -pedantic -D_GNU_SOURCE -I. -I../.. -AR=ar rc -RAN=ranlib - -OBJS=md5driver.o \ - md5.o \ - util.o \ - list.o \ - log.o \ - error.o \ - package.o \ - group.o \ - db.o \ - cache.o \ - conflict.o \ - deps.o \ - provide.o \ - rpmvercmp.o \ - backup.o \ - trans.o \ - add.o \ - remove.o \ - sync.o \ - handle.o \ - alpm.o - -all: libalpm.a - -%.o: %.c %.h - $(CXX) -c $(CFLAGS) -o $@ $< - -libalpm.a: $(OBJS) alpm.h - $(AR) $@ $(OBJS) - $(RAN) $@ - -clean: - rm -f *.o *~ core - rm -f libalpm.a diff --git a/lib/libalpm/Makefile.am b/lib/libalpm/Makefile.am new file mode 100644 index 00000000..57a8356b --- /dev/null +++ b/lib/libalpm/Makefile.am @@ -0,0 +1,31 @@ +AUTOMAKE_OPTIONS = gnu +DEFINES = -pedantic -D_GNU_SOURCE +AM_CFLAGS = $(DEFINES) + +TARGETS = md5driver.c \ + md5.c \ + util.c \ + list.c \ + log.c \ + error.c \ + package.c \ + group.c \ + db.c \ + cache.c \ + conflict.c \ + deps.c \ + provide.c \ + rpmvercmp.c \ + backup.c \ + trans.c \ + add.c \ + remove.c \ + sync.c \ + handle.c \ + alpm.c + +lib_LTLIBRARIES = libalpm.la + +libalpm_la_SOURCES = $(TARGETS) + +libalpm_la_LDFLAGS = -no-undefined -version-info $(PM_VERSION_INFO) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index b12defee..5ba0e1d7 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -25,7 +25,7 @@ * Arch Linux Package Management library */ -#define PM_VERSION "0.1.0" +/* #define PM_VERSION "0.1.0" */ /* Comes from autoconf's config.h */ #define PM_ROOT "/" #define PM_DBPATH "var/lib/pacman" diff --git a/lib/libftp/Makefile b/lib/libftp/Makefile deleted file mode 100644 index bf17940c..00000000 --- a/lib/libftp/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# -# This makefile contains modifications submitted by Richard Braakman -# (dark@xs4all.nl) for the shared library generation. -# - -# By default, ftplib uses PASV. If you need it to use PORT -# instead, uncomment the next line -DEFINES = -DFTPLIB_DEFMODE=FTPLIB_PORT - -SONAME = 3 -SOVERSION = $(SONAME).1 - -TARGETS = libftp.a libftp.so -OBJECTS = ftplib.o -SOURCES = ftplib.c - -CFLAGS = -Wall $(DEBUG) -I. $(INCLUDES) $(DEFINES) -LDFLAGS = -L. -DEPFLAGS = - -#all : $(TARGETS) -all : libftp.a - -clean : - rm -f $(OBJECTS) core *.bak - rm -rf unshared - -clobber : clean - rm -f $(TARGETS) .depend - rm -f libftp.so.* - -install : all - install -m 644 libftp.so.$(SOVERSION) /usr/local/lib - install -m 644 ftplib.h /usr/local/include - (cd /usr/local/lib && \ - ln -sf libftp.so.$(SOVERSION) libftp.so.$(SONAME) && \ - ln -sf libftp.so.$(SONAME) libftp.so) - -depend : - $(CC) $(CFLAGS) -M $(SOURCES) > .depend - -# build without -fPIC -unshared/ftplib.o: ftplib.c ftplib.h - -mkdir unshared - $(CC) -c $(CFLAGS) -D_REENTRANT $< -o $@ - -ftplib.o: ftplib.c ftplib.h - $(CC) -c $(CFLAGS) -fPIC -D_REENTRANT $< -o $@ - -libftp.a: unshared/ftplib.o - ar -rcs $@ $< - -libftp.so.$(SOVERSION): ftplib.o - $(CC) -shared -Wl,-soname,libftp.so.$(SONAME) -lc -o $@ $< - -libftp.so: libftp.so.$(SOVERSION) - ln -sf $< libftp.so.$(SONAME) - ln -sf $< $@ - -ifeq (.depend,$(wildcard .depend)) -include .depend -endif diff --git a/lib/libftp/Makefile.am b/lib/libftp/Makefile.am new file mode 100644 index 00000000..b53e4972 --- /dev/null +++ b/lib/libftp/Makefile.am @@ -0,0 +1,17 @@ +AUTOMAKE_OPTIONS = gnu +DEFINES = -DFTPLIB_DEFMODE=FTPLIB_PORT -D_REENTRANT +AM_CFLAGS = $(DEFINES) + +#SOMAJOR = 3 +#SOMINOR = 1 +#SOMICRO = 1 +#SOVER = `expr $(SOMAJOR) + $(SOMINOR)`:$(SOMICRO):$(SOMINOR) + +noinst_LTLIBRARIES = libftp.la +#lib_LTLIBRARIES = libftp.la + +libftp_la_SOURCES = \ + ftplib.h \ + ftplib.c + +#libftp_la_LDFLAGS = -L. -version-info $(SOVER) diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 00000000..c73ff8f7 --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,2 @@ +AUTOMAKE_OPTIONS = std-options +bin_SCRIPTS = gensync makepkg makeworld updatesync diff --git a/src/pacman/Makefile b/src/pacman/Makefile deleted file mode 100644 index a6b6cad2..00000000 --- a/src/pacman/Makefile +++ /dev/null @@ -1,41 +0,0 @@ - -CC=gcc -CFLAGS=-g -Wall -D_GNU_SOURCE -I. -I../.. -I../../lib/libalpm -I../../lib/libftp -LDFLAGS=-L../../lib/libalpm -lalpm -L../../lib/libftp -lftp -ltar -lz -AR=ar rc -RAN=ranlib - -OBJECTS=util.o \ - log.o \ - list.o \ - package.o \ - db.o \ - download.o \ - trans.o \ - add.o \ - remove.o \ - upgrade.o \ - query.o \ - sync.o \ - conf.o \ - pacman.o - -all: pacman - -%.o: %.c %.h - $(CC) -c $(CFLAGS) -o $@ $< - -pacman: $(OBJECTS) ../../lib/libalpm/libalpm.a ../../lib/libftp/libftp.a - $(CC) $(OBJECTS) -o $@ $(CFLAGS) $(LDFLAGS) -# $(CC) $(OBJECTS) -o $@.static $(CFLAGS) $(LDFLAGS) - -clean: - rm -f *.o *~ core - rm -f pacman pacman.static convertdb vercmp - -install: pacman vercmp convertdb - $(INSTALL) -D -m0755 pacman $(DESTDIR)$(BINDIR)/pacman - $(INSTALL) -D -m0755 pacman.static $(DESTDIR)$(BINDIR)/pacman.static - $(INSTALL) -D -m0755 vercmp $(DESTDIR)$(BINDIR)/vercmp - $(INSTALL) -D -m0755 convertdb $(DESTDIR)$(BINDIR)/convertdb - diff --git a/src/pacman/Makefile.am b/src/pacman/Makefile.am new file mode 100644 index 00000000..f8450b86 --- /dev/null +++ b/src/pacman/Makefile.am @@ -0,0 +1,20 @@ +bin_PROGRAMS = pacman pacman.static + +AM_CFLAGS = -D_GNU_SOURCE \ + -I$(top_srcdir)/lib/libalpm \ + -I$(top_srcdir)/lib/libftp + +pacman_SOURCES = util.c log.c list.c package.c db.c download.c trans.c add.c \ + remove.c upgrade.c query.c sync.c conf.c pacman.c + +pacman_static_SOURCES = $(pacman_SOURCES) + +pacman_LDADD = \ + $(top_srcdir)/lib/libalpm/libalpm.la \ + $(top_srcdir)/lib/libftp/libftp.la + +pacman_static_LDADD = \ + $(top_srcdir)/lib/libalpm/.libs/libalpm.a \ + $(top_srcdir)/lib/libftp/.libs/libftp.a $(LDFLAGS) + +pacman_static_LDFLAGS = -all-static diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 983d8402..00be4b83 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -591,7 +591,7 @@ void usage(int op, char *myname) void version() { printf("\n"); - printf(" .--. Pacman v%s\n", PM_VERSION); + printf(" .--. Pacman v%s - libalpm v%s\n", PACMAN_VERSION, PM_VERSION); printf("/ _.-' .-. .-. .-. Copyright (C) 2002-2005 Judd Vinet \n"); printf("\\ '-. '-' '-' '-' \n"); printf(" '--' This program may be freely redistributed under\n"); diff --git a/src/util/Makefile.am b/src/util/Makefile.am new file mode 100644 index 00000000..8fd81471 --- /dev/null +++ b/src/util/Makefile.am @@ -0,0 +1,11 @@ +bin_PROGRAMS = vercmp convertdb + +AM_CFLAGS = \ + -I$(top_srcdir)/lib/libalpm \ + -I$(top_srcdir)/src/pacman + +vercmp_SOURCES = vercmp.c +convertdb_SOURCES = convertdb.c + +vercmp_LDADD = $(top_srcdir)/lib/libalpm/libalpm.la +convertdb_LDADD = $(top_srcdir)/lib/libalpm/libalpm.la -- cgit v1.2.3-24-g4f1b