pbiering / ipv6calc

ipv6calc
https://www.deepspace6.net/projects/ipv6calc.html
Other
45 stars 15 forks source link

Pregenerated contrib/ipv6calc.spec is shipped in the source tree & tarball #39

Open paravoid opened 11 months ago

paravoid commented 11 months ago

While contrib/ipv6calc.spec is generated from contrib/ipv6calc.spec.in, the pregenerated file is shipped in the source tree and resulting tarball. This is unlike e.g. Makefiles, that are also generated from Makefile.in, but in this case no pregenerated Makefiles being shipped.

This results into a dirty source tree when running "make; make clean" and requires workarounds in the Debian package.

pbiering commented 11 months ago

@paravoid : a pregenerated ipv6calc.spec file is required to create RPM package using

rpmbuild -ta ipv6calc-<VERSION>.tar.gz
paravoid commented 11 months ago

But what happens if ipv6calc.spec is out of date and needs to be regenerated? Isn't that a chicken-and-egg loop?

To be more specific about the issue I'm trying to address:

root@4f83acec3998:/tmp/ipv6calc# git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
root@4f83acec3998:/tmp/ipv6calc# ./configure
checking for gawk... no
[...]
*** ENABLE_MOD_IPV6CALC        =0
root@4f83acec3998:/tmp/ipv6calc# git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   contrib/ipv6calc.spec

no changes added to commit (use "git add" and/or "git commit -a")

Same thing even if I run "make distclean" afterwards, for what it's worth.

paravoid commented 11 months ago

Hah, case in point: I think with cf02e4d075b1269b85aae9391a6e5d98358a1a87 you accidentally committed ipv6calc.spec with a dirty diff (no apxs installed).

pbiering commented 11 months ago

thank you for reporting, fixed by https://github.com/pbiering/ipv6calc/commit/3adc887090a5a80830bd52a8aedba72c8b03c273

pbiering commented 11 months ago

Imho the chicken-egg problem can't be solved except by taking care in the process not releasing code without having spec file proper updated (generated):

   BUILD OPTIONS
       The general form of an rpm build command is

       rpmbuild {-bSTAGE|-rSTAGE|-tSTAGE} [rpmbuild-options] FILE ...

       The argument used is -b if a spec file is being used to build the package, -r if a source package is to be  rebuilt  and  -t  if
       rpmbuild should look inside of a (possibly compressed) tar file for the spec file to use.