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