aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2007-06-05 16:28:35 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2007-06-05 16:28:35 +0000
commita4589d061217cec4ef6e8c35b936b9e52a98dfa8 (patch)
treef49c5a46ca25ff39dfd984dec68d03a5fed15e14
parent8f0b75c515933f6856f44fc6c26b8db4b29125ce (diff)
downloadrpm-setup-a4589d061217cec4ef6e8c35b936b9e52a98dfa8.tar
rpm-setup-a4589d061217cec4ef6e8c35b936b9e52a98dfa8.tar.gz
rpm-setup-a4589d061217cec4ef6e8c35b936b9e52a98dfa8.tar.bz2
rpm-setup-a4589d061217cec4ef6e8c35b936b9e52a98dfa8.tar.xz
rpm-setup-a4589d061217cec4ef6e8c35b936b9e52a98dfa8.zip
- provide a /etc/rpm/platform
-rw-r--r--Makefile.am23
-rw-r--r--configure.ac9
-rw-r--r--platform.in1
3 files changed, 29 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index 3fd71e1..27e2844 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,6 +11,11 @@ pkg_gdata = \
pkg_data_in = $(pkg_gdata:=.in)
+pkg_gconfig = \
+ platform
+
+pkg_gconfig_in = $(pkg_gconfig:=.in)
+
pkg_scripts = \
brp-compress \
brp-strip \
@@ -32,6 +37,7 @@ pkg_gscripts = \
find-provides \
find-requires \
find-provides.perl
+
pkg_scripts_in = $(pkg_gscripts:=.in)
BUILT_SOURCES = macros-perarch make_macrosfiles.sh
@@ -44,9 +50,12 @@ rpmeval_SOURCES = rpmeval.c
rpmeval_LDFLAGS = -lrpm
+noinst_DATA = $(pkg_gconfig)
+
pkglib_DATA = \
$(pkg_data) \
$(pkg_gdata)
+ $(pkg_gconfig)
pkglib_SCRIPTS = \
$(pkg_scripts) \
@@ -57,6 +66,7 @@ EXTRA_DIST = \
$(pkg_data_in) \
$(pkg_scripts) \
$(pkg_scripts_in) \
+ $(pkg_gconfig_in) \
macros-perarch.in make_macrosfiles.sh.in \
rpm-spec-mode.el \
tests.sh tests/macros.sh
@@ -67,7 +77,8 @@ edit = sed \
-e 's,@RPMCANONVENDOR\@,$(RPMCANONVENDOR),g' \
-e 's,@RPMLIBDIR\@,$(RPMLIBDIR),g' \
-e 's,@RPMSYSCONFDIR\@,$(RPMSYSCONFDIR),g'\
- -e 's,@RPMOS\@,$(RPMOS),g'
+ -e 's,@RPMOS\@,$(RPMOS),g' \
+ -e 's,@CANONTARGETCPU\@,$(CANONTARGETCPU),g'
%: %.in Makefile
$(edit) $< > $@
@@ -76,11 +87,15 @@ edit = sed \
arch=`echo $@ | sed 's,\\.macros,,'`; \
sh ./make_macrosfiles.sh macros-perarch $$arch > $@
-install-data-local: $(macrosfiles)
+install-data-local: $(macrosfiles) $(pkg_gconfig)
for i in $(RPMALLARCH); do \
$(mkinstalldirs) $(DESTDIR)$(RPMVENDORDIR)/$${i}-$(RPMOS); \
$(install_sh_DATA) $${i}.macros $(DESTDIR)$(RPMVENDORDIR)/$${i}-$(RPMOS)/macros; \
done
+ [ -d $(DESTDIR)$(RPMSYSCONFDIR) ] || $(mkinstalldirs) $(DESTDIR)$(RPMSYSCONFDIR)
+ for i in $(pkg_gconfig); do \
+ $(install_sh_DATA) $${i} $(DESTDIR)$(RPMSYSCONFDIR)/$${i}; \
+ done
.PHONY: ChangeLog test
@@ -88,9 +103,9 @@ ChangeLog:
LC_ALL=C svn2cl
rm -f *.bak
-test: $(pkg_gdata) $(pkg_gscripts) $(macrosfiles)
+test: $(pkg_gdata) $(pkg_gscripts) $(macrosfiles) $(pkg_gconfig)
sh tests.sh
-CLEANFILES = $(pkg_gdata) $(pkg_gscripts) $(macrosfiles) \
+CLEANFILES = $(pkg_gdata) $(pkg_gscripts) $(macrosfiles) $(pkg_gconfig)\
macros-perarch \
make_macrosfiles.sh
diff --git a/configure.ac b/configure.ac
index 94958de..38f271c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,28 +21,37 @@ AC_CHECK_LIB([rpmio], [rpmLoadMacroFile])
AC_HEADER_STDC
AC_CHECK_HEADERS([string.h rpm/rpmmacros.h rpm/rpmlib.h])
+CANONTARGETCPU=${target_cpu}
+
case "${target_cpu}" in
*86|athlon|k6)
RPMALLARCH="i386 i486 i586 i686 k6 athlon pentium3 pentium4"
+ CANONTARGETCPU=i586
;;
x86_64|amd64)
RPMALLARCH="i386 i486 i586 i686 k6 athlon pentium3 pentium4 amd64 x86_64"
+ CANONTARGETCPU=x86_64
;;
ppc|powerpc)
RPMALLARCH="ppc"
+ CANONTARGETCPU=ppc
;;
ppc64|powerpc64)
RPMALLARCH="ppc ppc32 ppc64"
+ CANONTARGETCPU=ppc64
;;
sparc|sparcv9)
RPMALLARCH="sparc"
+ CANONTARGETCPU=sparc
;;
sparc64)
RPMALLARCH="sparc sparc64"
+ CANONTARGETCPU=sparc64
;;
esac
RPMALLARCH="${RPMALLARCH} noarch"
AC_SUBST(RPMALLARCH)
+AC_SUBST(CANONTARGETCPU)
#
# get rid of the 4-th tuple, if config.guess returned "linux-gnu" for build_os
diff --git a/platform.in b/platform.in
new file mode 100644
index 0000000..6971170
--- /dev/null
+++ b/platform.in
@@ -0,0 +1 @@
+@CANONTARGETCPU@-@RPMCANONVENDOR@-@RPMOS@-gnu