aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.PL
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mageia.org>2010-11-04 17:31:43 +0000
committerOlivier Thauvin <nanardon@mageia.org>2010-11-04 17:31:43 +0000
commit5827f75824b0727be29116c49adbefa72aaaef9e (patch)
tree5811b05970c007e366eb802ba9d091a8c00a4b3f /Makefile.PL
parent83d413600adb4fb6c9c0056706b6174f65224b88 (diff)
downloadmgamirrors-5827f75824b0727be29116c49adbefa72aaaef9e.tar
mgamirrors-5827f75824b0727be29116c49adbefa72aaaef9e.tar.gz
mgamirrors-5827f75824b0727be29116c49adbefa72aaaef9e.tar.bz2
mgamirrors-5827f75824b0727be29116c49adbefa72aaaef9e.tar.xz
mgamirrors-5827f75824b0727be29116c49adbefa72aaaef9e.zip
- add target to make an rpm
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL32
1 files changed, 31 insertions, 1 deletions
diff --git a/Makefile.PL b/Makefile.PL
index 649120a..281736b 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,7 +6,7 @@ use Module::Install::Catalyst; # Complain loudly if you don't have
# Catalyst::Devel installed or haven't said
# 'make dist' to create a standalone tarball.
-name 'MGA-Mirrors';
+name 'mga-mirrors';
all_from 'lib/MGA/Mirrors.pm';
requires 'Catalyst::Runtime' => '5.80027';
@@ -26,3 +26,33 @@ catalyst;
install_script glob('script/*.pl');
auto_install;
WriteAll;
+
+package MY;
+
+sub postamble {
+
+"
+ChangeLog:
+\tsvn log > ChangeLog
+
+\$(DISTNAME).spec: \$(DISTNAME).spec.in Makefile
+\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@
+
+srpm: \$(DISTVNAME).tar.gz \$(DISTNAME).spec
+\trpmbuild -bs --clean\\
+\t --define \"_sourcedir `pwd`\" \\
+\t --define \"_specdir `pwd`\" \\
+\t --define \"_srcrpmdir `pwd`\" \\
+\t --define \"_rpmdir `pwd`\" \\
+\t \$(DISTNAME).spec
+
+rpm: \$(DISTVNAME).tar.gz \$(DISTNAME).spec
+\tmkdir ./noarch || :
+\trpmbuild -ba --clean\\
+\t --define \"_sourcedir `pwd`\" \\
+\t --define \"_specdir `pwd`\" \\
+\t --define \"_srcrpmdir `pwd`\" \\
+\t --define \"_rpmdir `pwd`\" \\
+\t \$(DISTNAME).spec
+"
+}