[Openais] [PATCH] corosync/trunk: add support for make rpm and make srpm targets

Fabio M. Di Nitto fdinitto at redhat.com
Thu Jun 25 06:40:58 PDT 2009


Hi Jim,

thanks for the input.. patch take2 in attachment should address all your
bits.

Fabio

On Thu, 2009-06-25 at 14:04 +0200, Jim Meyering wrote:
> Fabio M. Di Nitto wrote:
> > Howto:
> >
> > svn co...
> > ./autogen.sh
> > ./configure
> > make rpm or make srpm
> >
> > The resulting srpm can be built _without_ autotools installed
> > and the resulting rpm is equivalent of the one you would get from Fedora
> > rawhide.
> 
> I know what you mean, but just to clarify:
>   - building (i.e., creating) the srpm requires autoconf and automake.
>   - building *from* the srpm (as from any distribution tarball) does not.
> 
> ...
> > Index: Makefile.am
> > ===================================================================
> ...
> >  clean-generic:
> > -	rm -rf doc/api
> > +	rm -rf doc/api $(SPEC) $(TARFILE) *.rpm .build-*
> 
> Please don't remove names via wildcards like that.
> I might have a directory named PRECIOUS_IMPORTANT.rpm.build-DO_NOT_DELETE.
> 
> > +## make rpm/srpm section.
> > +
> > +$(SPEC): $(SPEC).in
> > +	LC_ALL=C date="$(shell date "+%a %b %d %Y")" && \
> > +	alphatag="$(shell svnversion)" && \
> > +	cat $^ | sed \
> > +		-e "s#@alphatag@#r$$alphatag#g" \
> > +		-e "s#@version@#$(VERSION)#g" \
> > +		-e "s#@date@#$$date#g" \
> > +	> $@
> 
> You can save a process, i.e., remove the cat:
> (also,
>   - using $< is slightly more precise than $^
>   - don't "redirect directly to target" (for why, search for that phrase)
>   - make the generated file read-only (i.e., harder to accidentally modify)
> 
> 	sed \
> 		-e "s#@alphatag@#r$$alphatag#g" \
> 		-e "s#@version@#$(VERSION)#g" \
> 		-e "s#@date@#$$date#g" \
> 	    $< > $@-t
> 	chmod a-w $@-t
> 	mv $@-t $@
> 
> > +srpm: clean $(SPEC) $(TARFILE)
> > +	rpmbuild \
> > +		$(RPMBUILDOPTS) \
> > +		--nodeps -bs $(SPEC)
> 
> These (above and below) don't do what you want when built with -jN.
> I.e., they'll run the clean rule and the ones to create
> $(SPEC) and $(TARFILE) in parallel.
> 
> You can use this in place of the above.
> 
> srpm: clean
> 	$(MAKE) $(SPEC) $(TARFILE)
> 	rpmbuild $(RPMBUILDOPTS) --nodeps -bs $(SPEC)
> 
> 
> > +rpm: clean $(SPEC) $(TARFILE)
> > +	rpmbuild \
> > +		$(RPMBUILDOPTS) \
> > +		-ba $(SPEC) 2>&1 | \
> > +	tee .build-$(VERSION).log
> _______________________________________________
> Openais mailing list
> Openais at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/openais
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rpm_support.diff
Type: text/x-patch
Size: 8117 bytes
Desc: not available
Url : http://lists.linux-foundation.org/pipermail/openais/attachments/20090625/e049af20/attachment.bin 


More information about the Openais mailing list