Typo.
[platform/upstream/rpm.git] / Makefile.am
1 # Top level Makefile for rpm
2
3 AUTOMAKE_OPTIONS = 1.4 foreign
4
5 EXTRA_DIST = CHANGES CREDITS README.amiga RPM-PGP-KEY \
6         autodeps/none autodeps/*.prov autodeps/*.req autogen.sh \
7         docs/[a-z]* gendiff groups $(man_MANS) po/*.in po/*.po po/rpm.pot \
8         rpm.magic rpmpopt rpm.spec rpm.8ru rpm2cpio.8ru
9
10 SUBDIRS = popt build lib po intl misc tools scripts tests .
11
12 INCLUDES = -I$(top_srcdir)/build -I$(top_srcdir)/lib -I$(top_srcdir)/intl @INCPATH@
13
14 mylibs= $(top_builddir)/build/librpmbuild.la \
15         $(top_builddir)/lib/librpm.la \
16         $(top_builddir)/popt/libpopt.la
17
18 LDFLAGS = @LDFLAGS_STATIC@
19
20 rpmbindir = $(subst usr/bin,bin,$(bindir))
21 rpmbin_PROGRAMS = rpm
22
23 bin_PROGRAMS =          rpm2cpio
24 bin_SCRIPTS =           gendiff
25 noinst_PROGRAMS =       rpmconvert
26
27 man_MANS = rpm.8 rpm2cpio.8     # rpm.8ru rpm2cpio.8ru
28
29 pkglibdir = @RPMCONFIGDIR@
30 pkglib_DATA = rpmrc rpmpopt macros
31 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
32         config.guess config.sub
33
34 noinst_HEADERS = \
35         acconfig.h      build.h         checksig.h      ftp.h   \
36         install.h       system.h        url.h   \
37         verify.h
38
39 rpm_SOURCES =           build.c checksig.c ftp.c install.c rpm.c url.c \
40                         verify.c
41 rpm_LDADD =             $(mylibs) @LIBMISC@
42
43 $(PROGRAMS):            $(mylibs) @LIBMISC@
44
45 .PHONY: lclint
46 lclint:
47         lclint ${DEFS} ${INCLUDES} ${rpm_SOURCES}
48
49 CVSTAG = r$(subst .,-,$(VERSION))
50
51 rpm2cpio_SOURCES =      rpm2cpio.c
52 rpm2cpio_LDADD =        $(mylibs)
53
54 rpmconvert_SOURCES =    convertdb.c oldrpmdb.c
55 rpmconvert_LDADD =      $(mylibs) -lgdbm
56
57 install-data-local:
58         @$(mkinstalldirs) $(DESTDIR)/var/lib/rpm
59         @rm -f $(DESTDIR)/$(libdir)/rpmrc
60         @ln -s rpm/rpmrc $(DESTDIR)/$(libdir)/rpmrc
61         @rm -f $(DESTDIR)/$(libdir)/rpmpopt
62         @ln -s rpm/rpmpopt $(DESTDIR)/$(libdir)/rpmpopt
63         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/BUILD
64         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/noarch
65         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/RPMS/@build_cpu@
66         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SOURCES
67         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SPECS
68         @$(mkinstalldirs) $(DESTDIR)/$(prefix)/src/redhat/SRPMS
69         @$(mkinstalldirs) $(DESTDIR)/var/lib/rpm
70         @$(mkinstalldirs) $(DESTDIR)/var/tmp
71
72 # FIXME: these should be checked
73 .PHONY:                tar
74 tar:
75         rm -rf /tmp/rpm-$(VERSION)
76         make installprefix=/tmp/rpm-$(VERSION)$(ROOT) install
77         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SOURCES
78         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SPECS
79         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SRPMS
80         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/RPMS
81         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/BUILD
82         $(mkinstalldirs) /tmp/rpm-$(VERSION)/var/local/lib/rpm
83         $(mkinstalldirs) /tmp/rpm-$(VERSION)/var/tmp
84 #       Couldn't figure de ARCH value   
85 #       $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/RPMS/i386
86         cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
87
88 .PHONY: noconfig
89 noconfig:
90         find . -name "Makefile" -exec rm {} \; 
91         rm -f *gz *rpm config.*
92
93 .PHONY: archive
94 archive: 
95         @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
96             echo " " ; \
97             echo "==> Please resolve differences between the repository and" ; \
98             echo "==> your rpm check out before tagging." ; \
99             echo " " ; \
100             cvs -n up ; \
101             echo " " ; \
102             exit 1 ; \
103         }
104         @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) .
105         @make dist
106         @echo " "
107         @echo "The final archive is ./rpm-$(VERSION).tar.gz."
108
109 .PHONY: nextsrpm
110 nextsrpm: all archive
111         @sudo ./rpm -ta rpm-$(VERSION).tar.gz