0

For a small project I have a perl script, a bunch of images and (in the future) a man page to install.

I'm looking for a simple "build" system under Linux (no Windows needed, and probably also no other Unices) which should have the following characteristics:

  • No bloat
  • No actual "build" needed, just an make install equivalent.
  • Should be able to install tools under defined prefixes, i.e. it should understand DESTDIR (default /) and PREFIX (default /usr/local) either as environment variables or as commandline parameters)

So basically I'd like something like a Makefile whose install target just does the right thing™. Unfortunately coding the Makefile yourself often leads to errors in corner cases, so I'd prefer something which e.g. generates the Makefile and don't reinvent the wheel.

So far I've looked at and found unsuitable:

  • GNU Autotools (Autoconf, Automake, …): Too bloaty for this little task
  • GNU Automake alone: Only generates Makefile.in to be generated by configure which again is generated by autoconf and hence can't be used without autoconf.
  • CMake: Too bloaty for this little task and I definitely prefer GNU Autotools over CMake. (And its focus on portability is completely irrelevant in this case.)
  • Dist::Zilla: Nice, but more targeted towards Perl Modules and can't install files to e.g. /etc/ (not yet needed, but that may change in the future)
  • scons: Citing from the Debian package description: "SCons rule sets are Python scripts".
  • dist: Too complex
  • makepp: Focus on C++, but still needs Makefiles to be written.

I'm unsure about ExtUtils::MakeMaker and Module::Build. Haven't written a Makefile.PL or a Build.PL by hand for a while.

Other tools I already stumbled upon but have not yet an idea how they work and if they might be suitable:

  • acr: Website currently dead (probably no good sign anyways)
  • cons Website dead, too, and cons is no more in CPAN, only in BackPAN
  • bmake + mkdep: On a first glance it seems still to need someone to write a Makefile.
  • What is your final goal? You distribute a single file, and your users can "run" the file to get everything installed and ready to use? Are you OK with formats like .deb and .rpm? – Nicolas Raoul Mar 1 '17 at 6:38
  • @NicolasRaoul: Actually my final goal is to have a decent Debian package, which does not have all logic inside the Debian packaging so that also packagers from other distribution can build upon something and do not need to reimplement what I did for Debian. For example debian/rules should only consist of %: and dh $@ plus optional parameters, but not have to many overrides. And the whole installation rules should not be in debian/install (i.e. a call to dh_install) but should be done by dh_auto_install (i.e. debhelper recognizing the build system and calling its install routine). – Axel Beckert Mar 2 '17 at 12:44
  • How about making an alien-compatible .deb? At worse, generated packages might need a bit of reworking. – Nicolas Raoul Mar 3 '17 at 1:33
  • @NicolasRaoul: IMHO, alien is a crutch which should be only used if nothing else is possible, e.g. for propietary programs only shipped as (usually) RPM. I'd never even consider using it for free software. There you have far better possibilities. – Axel Beckert Mar 3 '17 at 13:58
0

Writing that question down already lead me to the right solution: Using the Makefile.PL generated by modulemaker (module-starter probably works as well), adding File::ShareDir::Install to it (and File::ShareDir to the script) and do some fine-tuning to it did the job:

I ended up with a mostly generated and rather readable 18 lines Makefile.PL.

Update a few hours later:

… which I had to expand by quite some lines which duplicated lists from elsewhere. That again annoyed me and reminded me what I like with Dist::Zilla. So in the end, I switched to using Dist::Zilla with a few one-time quirks. :-)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.