git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |gzip > dracut-$(VERSION).tar.gz
rpm: dracut-$(VERSION).tar.bz2
- mkdir -p rpmbuild
- cp dracut-$(VERSION).tar.bz2 rpmbuild
- cd rpmbuild; ../git2spec.pl $(VERSION) < ../dracut.spec > dracut.spec; \
- rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
+ rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
+ cp dracut-$(VERSION).tar.bz2 "$$rpmbuild"; \
+ $$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
+ (cd "$$rpmbuild"; rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
- --define "_rpmdir $$PWD" -ba dracut.spec && \
- ( cd ..; mv rpmbuild/noarch/*.rpm .; mv rpmbuild/*.src.rpm .;rm -fr rpmbuild; ls *.rpm )
+ --define "_rpmdir $$PWD" -ba dracut.spec; ) && \
+ ( mv "$$rpmbuild"/noarch/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr "$$rpmbuild"; ls *.rpm )
syncheck:
@ret=0;for i in dracut-logger modules.d/99base/init modules.d/*/*.sh; do \
sub create_patches {
my $tag=shift;
+ my $pdir=shift;
my $num=0;
- open( GIT, 'git format-patch -N --no-signature '.$tag.' |');
+ open( GIT, 'git format-patch -N --no-signature -o "'.$pdir.'" '.$tag.' |');
@lines=<GIT>;
close GIT; # be done
return @lines;
my $datestr = strftime "%Y%m%d", gmtime;
my $tag=shift;
+my $pdir=shift;
$tag=&last_tag if not defined $tag;
-my @patches=&create_patches($tag);
+my @patches=&create_patches($tag, $pdir);
my $num=$#patches + 2;
$tag=~s/[^0-9]+?([0-9]+)/$1/;
my $release="$num.git$datestr";