Add header preinstallation.
authorRalf Corsépius <corsepiu@fedoraproject.org>
Thu, 22 Nov 2007 14:54:42 +0000 (15:54 +0100)
committerRalf Corsépius <corsepiu@fedoraproject.org>
Thu, 22 Nov 2007 14:54:42 +0000 (15:54 +0100)
Makefile.am
configure.ac
preinstall.am [new file with mode: 0644]

index 46e22cb..779b42d 100644 (file)
@@ -7,7 +7,8 @@ include $(top_srcdir)/rpm.am
 CLEANFILES =
 EXTRA_DIST = CHANGES ChangeLog CREDITS GROUPS INSTALL \
        autodeps autogen.sh \
-       db db3/configure installplatform platform* 
+       db db3/configure installplatform platform*
+BUILT_SOURCES =
 
 SUBDIRS = po misc
 if WITH_INTERNAL_DB
@@ -374,12 +375,13 @@ EXTRA_DIST += doc/librpm/html
 if WITH_INTERNAL_DB
 db.h:  $(top_builddir)/db3/db.h
        $(LN_S) $(top_builddir)/db3/db.h $@
-BUILT_SOURCES = db.h
+BUILT_SOURCES += db.h
 endif
 DISTCLEANFILES += db.h
 
 clean-local:
        rm -rf doc/hacking/html
+       rm -rf include
 
 distclean-local:
        rm -rf Doxytags
@@ -388,3 +390,18 @@ distclean-local:
 maintainer-clean-local:
        rm -rf doc/librpm/html
 
+$(top_srcdir)/preinstall.am: Makefile.am
+       rm -f preinstall.am
+       @for f in $(HEADERS); do \
+         b=`basename $$f`; \
+         echo 'include/rpm/'$$b': '$$f include/rpm/$(dirstamp) >> $(top_srcdir)/preinstall.am;\
+         echo '        $$(INSTALL_DATA) '$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
+         echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
+         echo 'CLEANFILES += include/rpm/'$$b  >> $(top_srcdir)/preinstall.am; \
+        done
+
+include/rpm/$(dirstamp):
+       @$(MKDIR_P) include/rpm
+       @: > include/rpm/$(dirstamp)
+
+include $(top_srcdir)/preinstall.am
index 313f322..73a261c 100644 (file)
@@ -1060,6 +1060,8 @@ AS_IF([test "$ac_cv_header_stdint_h" = "yes"],[
 AC_DEFINE([__RPM_USES_STDINT_H__],[1],[if rpm uses stdint.h])
 ])
 
+AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
+
 AC_CONFIG_HEADERS([rpmdb/rpmints.h])
 
 AC_CONFIG_FILES([Makefile
diff --git a/preinstall.am b/preinstall.am
new file mode 100644 (file)
index 0000000..e69de29