Commit Graph

250 Commits

Author SHA1 Message Date
loic.chabert 788387c0d2 Add space on changes.erb to conform with debian specs 2022-10-03 13:34:22 -07:00
loic.chabert 37f56269c3 Replace whatever in changelog.erb and deb.changes.erb
In order to support packaging upload, the distribution must be
set/aligned in changelog and changes files.
Required for example inside dput-ng repo upload app.
2022-10-03 13:34:22 -07:00
Jordan Sissel 541550a74d Allow versions in `Provides` field for Debian packages
This fixes #1788. This also reverts #280. For #280, at the time, this
change to ignore versions was correct. Two years after #280, Debian
began allowing `Provides` field to have versions.

This change also fixes bug in gem-to-deb conversion where previously an
incorrect Provides syntax would be generated (but thanks to #280,
removed), so this bug was only noticed after #280 was undone!

Computers are hard sometimes.

Added tests for gem-to-deb conversion specifically for the Provides
field.

Tested manually with Docker on Ubuntu 14.04 and 18.04 and results meet
expectations.

The history here is follows:
* In 2012, fpm was patched to remove version specifiers in Provides
  field because Debian didn't support it.
* In 2014, Debian dpkg[1] added support for versions in Provides field
* Somewhere between 2015-2018, Debian and Ubuntu included this new
  version of dpkg.
* Debian packaging policy docs (v4.4.0) was updated to allow versions
  in the Provides field.

Expected impacts:
* Older versions of dpkg/etc should _ignore_ the presence of a version
  specifier. Testing on Ubuntu 14.04 confirmed this.
* Newer versions of dpkg/etc should respect the presence of a version
  specifier. Testing on Ubuntu 18.04 confirmed this.

[1] https://launchpad.net/debian/+source/dpkg/1.17.11
2021-07-06 14:25:06 -07:00
Jo Vandeginste 067f4ccfd0 Add back newlines after sections with macro expansion
The previous commit eats too much whitespace after the section headers
(`%pre`, `%post` etc.). There should remain a newline.

Correct versions (for `%pre`):

```
%pre
ugrade () {
```

and

```
%pre -e
upgrade() {
```

Without this patch, we get these (wrong):

```
%pre ugrade () {
```

and

```
%pre -e upgrade() {
```

(exact number of spaces can be different, but should not be relevant)

Fixes #1750

Signed-off-by: Jo Vandeginste <Jo.Vandeginste@kuleuven.be>
2021-06-19 00:16:58 -07:00
Jordan Sissel 72a925b048 Ensure an if-then-else doesn't have an empty if block
Issue #1749
2021-06-17 08:30:31 -07:00
Andreas Ulm c795ed7ef4 implemented --deb-maintainerscripts-force-errorchecks (#1696)
Switched from always enabling errexit to fpm parameter as result of
discussion in #1696.

Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
2021-01-19 14:33:01 -08:00
Andreas Ulm feb53faa14 added set -e to debian maintainer scripts #1696
Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
2021-01-19 14:33:01 -08:00
James Logsdon 204fb1b1ff Use head/tail over sed for metadata fetching in sh.erb template 2021-01-19 12:49:18 -08:00
Julian Trzeciak 8a40cd1db7 rpm: add option to enable install-time macro expansion in scripts
- spec file sections affected: %pre %post %preun %postun
2020-03-07 19:46:46 -08:00
c-ameron d7b466787d default to false for deb-systemd starts 2019-03-25 22:15:44 -07:00
c-aamm e066e632ed remove multiple systemd services on uninstall 2019-03-25 22:15:44 -07:00
c-aamm 823b3947fc allow starting of multiple deb systemd services 2019-03-25 22:15:44 -07:00
c-aamm a7626cb99b Allow auto-enable and auto-start for deb-systemd services after install
Adds in two new options to enable/disable and autostart systemd services
--[no-]deb-systemd-enable to enable the systemd service after install
--[no-]deb-systemd-auto-start to auto start the service after install

Additionally, any service start/stop/restart will use deb-systemd-invoke
wrapper if installed on the system
2019-03-25 22:15:44 -07:00
Morgan Rhodes 1f2f950581 Use `fix_dependency` when populating debian `Replaces` field (#1442)
The `Replaces` field needs to be formated 'package (operator version)'.
This makes use of the `fix_dependency` method for consistent formatting
with other dependencies.
2018-10-25 10:23:16 -07:00
Fabian Mettler fa0d15d581 FIX: Proper indentation for changes (#1552)
Set the expected indentation format in changes according to the documentation: https://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog
2018-09-10 17:37:30 -07:00
Timo Boettcher 07b0be428e Generate .changes file for Debian
This will generate .changes file for Debian packages. Some Debian
repository management tools use .changes files for importing packages.
The command line option --(no-)deb-generate-changes allows to select to
generate the .changes file, the option --deb-dist allows to set a
distribution (like sid) for the package.
2018-05-12 21:05:27 -07:00
Jordan Sissel a996a8a404 Allow noarch rpms to contain binaries.
The reasoning for this is that some projects may ship single packages
containing everything necessary. For example, `Netty` and `JRuby` are
Java projects which contain platform-specific (for many platforms)
libraries -- for example, libjffi.
2017-12-24 06:00:04 -08:00
Torsten Schmidt c4b3cd863e fix: install loop problem in rpm.erb
When using install command (from /usr/bin/install) in after_install
shell in creates a endless loop, because it jumps to funtion beginning
of install(). So it's best practise to rename it to _install() to avoid
collision with /usr/bin/install command
2017-12-23 12:59:44 -08:00
Alexander Weidinger 127b29194a Add --deb-after-purge FILE 2017-07-20 16:41:15 -07:00
Dan Kegel 14c4819e41 Implement reproducible gem -> deb conversion (#1360)
* Add option --source-date-epoch-default and implement for deb output.

This is the first step towards supporting bit-for-bit identical
output files given identical inputs.

Alas, Apple's ar is not too good at reading gnu ar archives,
so always use ar_cmd to find ar.

* deb: remove lines duplicated in a tragic merge conflict

Probably introduced by 62d0060178 and not removed by 500f0c052f

* Add options --source-date-epoch-from-changelog and --gem-stagingdir to support bit-for-bit reproducible gem -> deb conversion

In those cases where we can get the release date out of the changelog,
use it; otherwise fall back to the value given by SOURCE_DATE_EPOCH aka --source-date-epoch-default.

--gem-stagingdir is a bit of a kludge, only needed because no
compiler supports https://reproducible-builds.org/specs/build-path-prefix-map/ yet.
Could have been global option, but not sure any other package handler
invokes compilers?  Could hoist it up later.

Also:
- Defer initializing staging_path so subclasses can sneak in new value
- gem: remove build files

* gem: handle a few more gem changelog variants

* gem: also remove mkmf.log; lets ffi, kgio, raindrops, and ruby-ldap build reproducibly.

* deb: don't expect diffoscope to be installed in /usr/bin.  Lets it be found on mac.

* gem: document new options
2017-07-20 12:33:14 -07:00
luto 3338aa8f4b remove trailing slash from --prefix option in rpm-packages, fixes #819 2016-06-23 02:18:01 +02:00
TomyLobo 7e91faf92d Skip certain control file entries if their lists are empty.
For #1126
2016-06-18 04:38:28 -07:00
Michal Mach 18a4ab964d Fix for ignoring --rpm-tag option on command line 2016-06-15 18:40:52 +00:00
Jordan Sissel 76c41ea5f7 Check for /lib and /usr/lib. Debian uses /lib, everyone else seems to use /usr/lib. 2016-05-16 05:22:41 -07:00
Jordan Sissel 37ccaa007b Add comment 2016-05-15 04:23:03 -07:00
Jordan Sissel 0a2badb1c8 Refactor. Also now we attempt cleanup upon package removal.
The `install.sh` will generate a cleanup.sh script that is executed when
the package is removed.
2016-05-15 04:09:19 -07:00
Jordan Sissel 7a07301141 Disable freebsd for now, until rcng support is added to pleaserun. 2016-05-14 22:26:16 -07:00
Jordan Sissel 82cecf3037 Some small fixes
* Only try install actions if they exist
* Add special case for Upstart 0.6.5 (CentOS 6)
2016-05-14 22:00:41 -07:00
Jordan Sissel e1336aafda Make copying not rely on rsync. Also tell the user if no platform was detected. 2016-05-14 17:35:02 -07:00
Jordan Sissel 5dc70815a1 WIP continues. 2016-05-14 04:01:26 -07:00
Paweł Tomulik eca336bc13 fix sh.erb to prevent empty function set_post_install_vars 2016-04-07 23:09:46 +02:00
Jens Peter Schroer 500f0c052f fixing merge conflicts 2015-11-17 17:17:47 +01:00
Jens Peter Schroer 62d0060178 let fpm generate the systemd start / stop commands as well 2015-11-17 17:07:26 +01:00
Jordan Sissel 28d9bf5e45 Merge branch 'feature/arch-support' of https://github.com/djhaskin987/fpm into djhaskin987-feature/arch-support 2015-11-07 12:40:23 -08:00
Jordan Sissel 93382dcdb3 Merge pull request #687 from vStone/feature/rpm-custom-requires
rpm: Add a option to insert raw Require statements
2015-11-07 12:01:22 -08:00
Daniel Haskin 197e8dbe60 Fix the bug brought up by @ServiusHack 2015-09-16 20:52:04 -06:00
Daniel Haskin 2303eef05c Merge branch 'jsl/master' into feature/arch-support 2015-09-16 19:58:19 -06:00
Ed Healy 21c42f40ea Correct detection of existing .old file in releases directory in shell template.
Conflicts:
	templates/sh.erb
2015-09-14 10:03:35 -04:00
Ed Healy 4689a59055 add -h to detect current folder symlink in shell template. 2015-09-14 10:02:54 -04:00
Ed Healy 533311dfb5 export slug metadata as env vars for use in post install scripts for shell template. 2015-09-14 10:02:30 -04:00
Jens Peter Schroer f92427dc8a adding flag to trigger systemd service restart after upgrade 2015-09-08 14:10:23 +02:00
Matt Sharpe 0247b382a4 #903 add --rpm-summary flag and tests 2015-08-10 22:56:24 +10:00
Joseph Frazier 3164452148 Don't crash on empty description when building RPM
Closes #825, #973
2015-08-06 22:58:38 -07:00
Jens Peter Schroer c0021cbb74 let fpm generate the systemd start / stop commands as well 2015-07-10 17:34:12 +02:00
Jordan Sissel ae9de095dc Merge pull request #692 from adamonduty/rpm_dist
Support RPM dist tag
2015-06-30 10:39:14 -07:00
Daniel Haskin bc37e60568 Merge branch 'master' into feature/arch-support 2015-05-09 11:50:56 -06:00
Daniel Haskin 94eb39cc1f Fix ALL the pacman specs 2015-05-09 11:17:57 -06:00
Daniel Haskin ff5b5b8fb2 Fix more pacman tests 2015-05-08 19:59:38 -06:00
Jordan Sissel 3bfb7dd64e Merge pull request #828 from gerbercj/feature/sh_metadata
Add package metadata to slug file format
2015-05-07 13:17:31 -07:00
Jordan Sissel 23fac4f4dd Merge pull request #913 from djhaskin987/feature/sh-before-install-script
Feature: sh before-install script
2015-05-07 12:29:52 -07:00