Commit Graph

270 Commits

Author SHA1 Message Date
Thiago Figueiró d2a71442c1 Add tar spec for #1123 2017-07-20 14:12:18 -07:00
Nemanja Boric fcd4dfd631 In case of a=b syntax where a is symlink, don't create directory (#1253)
Previously, if the symlink is included into the package and specified
with

my-sym-link.so=/usr/lib/my-sym-link.so

fpm would create directory, and put the
symlink inside `/usr/lib/my-sym-link.so/my-sym-link.so
which is very surprising and it doesn't follow the same
pattern as file copying is doing.

Fixes #1135
2017-07-20 14:00:21 -07:00
ServiusHack a3ddf38b84 Fix copy_entry for symlinks (#1348)
* Add test for copying symlinks

The test explicitly sets `preserve=true` and `remove_destination=true`
to show the currently broken behavior.

* Fix copy_entry for symlinks

The fourth argument to FileUtils.copy_entry is dereference_root to
which the value of remove_destination was passed.

The fix now passes the parameters in the required position.
2017-07-20 13:11:28 -07:00
Philippe Poilbarbe c2db5985f6 Added --deb-interest-noawait and --deb-activate-noawait (#1225) (#1359) 2017-07-20 13:05:03 -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
Nick Griffiths 719fec630c Fix weird clipboard fart 2016-12-30 20:01:47 +13:00
Nick Griffiths d72ea6c625 Fix for #1248 - fix prefix behaviour 2016-12-30 19:57:15 +13:00
Jordan Sissel 40aa7cf5ca Move fpm version query behavior to `run` method.
A bug pointed out by #1162 showed that `fpm --version` would fail when
a .fpm file was loaded.

Moving the short `fpm --version` handling to the `run` method lets us do
this check before we load FPMOPTS env or .fpm files.

Updated the tests to only try calling with a lone `-v` or `--version`
flag to verify this works with and without a .fpm file.

Fixes #1162 and #1125. Original work by @drwl!
2016-09-11 23:48:39 -07:00
Andrew Lee a6f25b9fda Fix --version when .fpm file exists 2016-09-11 23:48:17 -07:00
Matt Sharpe 0e9e8f0a43 Add long flag options for chdir, input, and output
The flags for chdir, input, and output aren't immediately intuitive
as to what they're short for. This commit adds long versions and a
spec stub for chdir. Resolves #1187.
2016-09-02 17:19:12 +10:00
Jordan Sissel 40ec0c3576 Merge pull request #1139 from luto/bugfix/1124
fix --workdir not having an effect on the build and staging dirs, fixes #1124
2016-07-25 16:14:44 -07:00
Andreas Zuber 8add9bcdd6 gem: make it posssible to set the shebang
This makes it possible to create packages from gems for ruby versions
which are not currently installed on the machine you build the package on.
2016-07-22 09:02:39 +02:00
luto 3338aa8f4b remove trailing slash from --prefix option in rpm-packages, fixes #819 2016-06-23 02:18:01 +02:00
luto 454754064f fix --workdir not having an effect on the build and staging dirs, fixes #1124 2016-06-22 01:50:44 +02:00
Nick Griffiths 66e59e79e8 Support building a virtualenv from local requirements.txt 2016-06-18 13:37:24 -07:00
Nick Griffiths d0eaf77921 Add some basic specs for the virtualenv package 2016-06-18 13:37:24 -07:00
Jordan Sissel 7bc5fba4bd Start work for acceptance tests. 2016-05-23 11:28:51 -07:00
Jordan Sissel 2ee569a1e4 Fix an RPM spec failure on Fedora 23 2016-05-16 04:18:20 -07:00
Jordan Sissel 37e8b88a6b Fix specs failing when the host is freebsd 2016-05-11 12:12:37 -07:00
Paweł Tomulik dc7e73237d add FPM::Util.execmd and fix python_spec.rb 2016-04-19 05:59:13 +02:00
Jordan Sissel f4f49e68ea Fix failing test on Fedora 23
Fedora 23's bindir for python defaults to /usr/bin, so the hardcoding of
/usr/local/bin was causing one spec to fail.
2016-04-12 21:12:03 -07:00
Paweł Tomulik af64fdfced remove the line with $CHILD_STDERR 2016-04-11 19:12:39 +02:00
Paweł Tomulik 5e24991fed fix python_spec.rb to run smoothly on Unix 2016-04-08 01:23:59 +02:00
Paweł Tomulik 78303be699 further fixes to deb lintian test 2016-04-07 22:36:09 +02:00
Paweł Tomulik 9dcd9f1379 fix to make deb lintian test passing 2016-04-07 17:33:36 +02: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 49622ecc3c Merge pull request #917 from djhaskin987/feature/sh-before-install-spec
Add specs for PR #913
2015-11-07 12:31:07 -08:00
Jordan Sissel 5f30e89b99 Merge pull request #849 from BaxterStockman/cpan-metadata
Use MetaCPAN API query data as fallback for package metadata
2015-11-07 12:22:12 -08:00
Jordan Sissel 0829c4e72e Merge pull request #756 from pstengel/feature/rake
Add RakeTask
2015-11-07 12:07:07 -08:00
Daniel Haskin 5d17bbda86 Make specs pass for archlinux 2015-10-08 22:12:05 -06:00
Daniel Haskin 2303eef05c Merge branch 'jsl/master' into feature/arch-support 2015-09-16 19:58:19 -06:00
Matt Sharpe 0247b382a4 #903 add --rpm-summary flag and tests 2015-08-10 22:56:24 +10:00
Matt Schreiber 3c86f18983 Set :cpan_test? attribute to false for IPC::Session rspec test 2015-08-09 21:02:20 -04:00
Matt Schreiber 1b353244e1 initial commit of new rspec test
of CPAN module without META.* file
2015-08-09 20:47:49 -04:00
Jordan Sissel fa0c173f94 Merge pull request #943 from iordanisg/dev-debmetafile
Fixed  deb_meta_file symbol name
2015-08-06 23:09:22 -07:00
Jordan Sissel 6f7616b20f Add tests to cover empty and one-line descriptions for rpms
For #973
2015-08-06 22:58:48 -07:00
Jordan Sissel ae9de095dc Merge pull request #692 from adamonduty/rpm_dist
Support RPM dist tag
2015-06-30 10:39:14 -07:00
iordanisg f187b2426b Update deb_spec.rb
Fixing symbol name
2015-06-17 14:34:32 +02:00
Paul Stengel ae112bf56e Refactor for Ruby 1.8.7 and add spec 2015-05-16 15:32:38 -04:00
Daniel Haskin 4046f6643e Add specs for PR #913 2015-05-09 16:37:12 -06: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 f8e5cf7316 Add a todo in the pacman spec 2015-05-08 20:01:08 -06:00
Daniel Haskin ff5b5b8fb2 Fix more pacman tests 2015-05-08 19:59:38 -06:00
Daniel Haskin dabdee0a5b Fix more pacman tests 2015-05-08 18:26:31 -06:00
Daniel Haskin 9d2c7478d9 Fix the main pacman permissions bug 2015-05-08 17:56:24 -06:00
Jordan Sissel 612fa731cb Remove python_install_bin setting; this was causing the tests to fail on OSX 2015-05-07 13:32:39 -07:00
Jordan Sissel 6f59bf3d8e Merge pull request #844 from cure/master
Add --python-disable-dependency option to disable specific python dependencies
2015-05-07 13:20:20 -07: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
Daniel Haskin 2135264dbe Remove unnecessary requires lines from spec 2015-05-06 21:17:26 -06:00
Daniel Haskin b78e36cd26 Add empty as output target for testing purposes 2015-05-06 21:13:48 -06:00
Daniel Haskin 0ec2e599c3 Add TODO 2015-05-06 20:30:02 -06:00
Adam Lamar e3a8f2f8ef Scope --rpm-dist to rpm.rb 2015-05-06 20:54:51 +00:00
Daniel Haskin 829b664584 Write the test that duplicates the file permissions pacman bug 2015-05-05 23:28:55 -06:00
Daniel Haskin ad4e7572d6 Add bogus dependencies test & functionality 2015-05-05 22:10:26 -06:00
Daniel Haskin 0591af7ab2 Ensure basic unit tests pass for pacman 2015-05-05 00:10:03 -06:00
Daniel Haskin 6136ae409d Add preliminary unit tests for pacman 2015-05-02 21:52:49 -06:00
Jordan Sissel 9f9635d2b3 Merge pull request #877 from vincentbernat/fix/debian-etc-in-conffiles
For Debian packages, register files in `/etc` as conf files
2015-04-24 16:47:17 -07:00
Vincent Bernat 5ecda8ba17 For Debian packages, register files in `/etc` as conf files
When building Debian packages with debhelper, files in `/etc` are
automatically marked as configuration files (this is done since
compatibility level 3 which was introduced in 2000). Therefore, packages
built with fpm may come as a surprise since they don't do that. A user
can still add `--config-files /etc` but they have to know that (usually
after a valuable modification has been erased).

This change add `/etc` to the list of configuration files for Debian
unless fpm is invoked with `--deb-no-config-files`.

Closes: #873
2015-04-15 17:26:17 +02:00
Maxime Caumartin 2e937359dc Add RPM input tests 2015-04-13 22:56:34 -07:00
Jordan Sissel 88ec5da177 Strip trailing whitespace
This was accomlished with this sed invocation (OSX):

    sed -Ei "" -e 's/ +$//' {lib,spec}/**/*.rb

(It would be `-r` instead of `-E` on systems with GNU sed)

Anyway. I did this because I'm frustrated folks unintentionally submit
patches with tons of whitespace changes done automatically by their
editor and without confirmation. The whitespace changes make `git blame`
lie, and it also makes doing the code review more difficult. While
Github is capable of showing a code diff that ignores whitespace (via
`?w=1`), that view does not permit commenting on the code change.
2015-04-13 22:32:31 -07:00
Jordan Sissel 4d58315679 Merge pull request #890 from vincentbernat/fix/lintian-rspec
rspec: fix lintian test
2015-04-13 16:22:20 -07:00
Jordan Sissel cd423a2dd7 Continuation of efforts to improve how fpm uses rspec.
This makes use of shared examples, rspec's expect (instead of my
insist), and cleans up some longer tests that had complex 'it' blocks
into before/let/it.
2015-04-10 16:52:06 -07:00
Vincent Bernat 682ed48715 rspec: fix lintian test
lintian expects the package name to ends with ".deb". Also, rspec
disallows the use of a let variable in an `after(:context)` hook. Also
fix the name of instance variable `@staging_path`.
2015-04-10 13:49:38 +02:00
Jordan Sissel b8a4a3fbc7 Grand refactor to use my newer rspec style
* Resolve any ruby warnings (ruby -wc)
* Use expect().to(...) instead of insist { ... }
* Avoid `:all` in hooks
* Use `let` instead of instance variables
* Use Stud::Temporary instead of Tempfile
2015-04-09 23:42:41 -07:00
Jordan Sissel a1ad3e4760 Fix a failing test on OSX that required 'dpkg-deb'
Switched to using `ar p ... | tar -zx` instead. Test passes on OSX.

I also took this as an opportunity to update the style to use rspec a
bit better. Using `let` and avoiding `before :all` and such.
2015-04-09 23:13:43 -07:00
Ward Vandewege 04804f672c Add tests for python dependency manipulation. Also switch
spec/fixtures/python/setup.py from distutils to setuptools.
2015-03-14 21:02:16 -04:00
Chris Gerber ccc0d9075c Add some basic specs for the SH package 2015-01-28 15:02:33 -05:00
Jordan Sissel 8679dcb26c Fix a whole bunch of Ruby 1.8.7 bugs
There are still 4 test failures:

* rspec ./spec/fpm/package/rpm_spec.rb:297 # FPM::Package::RPM#output package attributes should have the correct 'after_target_uninstall' trigger script
* rspec ./spec/fpm/package/rpm_spec.rb:288 # FPM::Package::RPM#output package attributes should have the correct 'before_uninstall' trigger script
* rspec ./spec/fpm/package/rpm_spec.rb:279 # FPM::Package::RPM#output package attributes should have the correct 'after_install' trigger script
* rspec ./spec/fpm/package/rpm_spec.rb:270 # FPM::Package::RPM#output package attributes should have the correct 'before_install' trigger script
2014-10-25 21:23:49 +00:00
Jordan Sissel d9df69cf4a Add npm specs 2014-10-25 05:41:28 +00:00
Maxime Caumartin 8d38574b7e Add input and output rpm trigger support
This adds several rpm-specific flags:

--before-install
--after-install
--before-uninstall
--after-target-uninstall

Fixes #626 (merged by hand)
2014-10-25 05:36:37 +00:00
Jordan Sissel a04a3bcb9a Move from @logger ivar to logger method.
Tests pass. Hope is all we have. And hugs.
2014-10-25 05:28:16 +00:00
Jordan Sissel 025642814a Fix typo from previous commit 2014-10-25 04:51:53 +00:00
Grantlyk df56dcc01f Adding validation to stop debian users entering names with spaces
Fixes #779
2014-10-25 04:51:53 +00:00
Jordan Sissel 0045f0095a Don't follow symlinks when copying files.
Added test coverage to ensure a broken symlink doesn't throw a ENOENT
error. The test was written first, and failed, but now passes with the
fix to the dir package.

Fixes #658
2014-10-25 01:39:42 +00:00
Jordan Sissel 8a29dd5ea0 Add --log=xxx support
Supported log levels: error, warn, info, debug.

--verbose is the same as --log=info
--debug is the same as --log=debug
--log=warn is the default

Requested by mattgreenrocks on irc.
2014-10-15 18:29:42 +00:00
Jordan Sissel 811148e5c5 Merge pull request #694 from vStone/bugfix/fix-python-tests-python3
Fixes 2 python issues within the tests
2014-09-18 10:44:35 -07:00
Jordan Sissel 99ffdcd986 Fix typo in test that was causing it to fail. 2014-07-25 13:43:43 +00:00
Jordan Sissel db8ddf4ce2 Ignore cabin subscriptions during testing
This prevents the command lib from subscribing to stdout and causing
warnings to show up during tests.
2014-07-24 19:24:28 +00:00
Jordan Sissel 4c17e1c048 Merge pull request #688 from vStone/bugfix/fix_version_bins_with_no_bins
Fixes an issue where gem-version-bins is enabled but there are no binaries
2014-07-24 12:06:07 -07:00
Jordan Sissel f6379e02a7 Merge pull request #695 from dwb/triggers
dpkg arbitary meta files and triggers
2014-07-24 11:36:55 -07:00
Jordan Sissel 2902c04620 Merge pull request #696 from vStone/bugfix/debian-control-file-permissions
Bugfix/debian control file permissions
2014-07-24 11:29:55 -07:00
Jordan Sissel 9ae5c753b6 Merge branch 'pr/693' (from #693 + typo patch fix) 2014-06-19 05:59:39 +00:00
Jordan Sissel e1a397a69c Fix typo 2014-06-19 05:59:09 +00:00
Jordan Sissel d3e72d36f5 Use rspec 3.0.0
Ran transpec on spec/ directory for automatic and delicious upgrades.

Also removed minitest dependency since fpm doesn't use it.
2014-06-19 05:32:11 +00:00
Jordan Sissel b3d315b470 Merge branch 'master' of https://github.com/remh/fpm into remh-master
Conflicts:
	lib/fpm/package/rpm.rb
2014-06-18 06:52:42 +00:00
Jan Vansteenkiste 2bd2a1e179 Since #480, no default path is set so we should define one for testing python 2014-06-10 08:21:21 +02:00
Jan Vansteenkiste 43ea0a4bdb Fixes python tests where python 3.x is installed 2014-06-10 08:21:21 +02:00
Jan Vansteenkiste e1e35f8dfb Ignore lsb init scripts warning since we are not providing a proper init script for testing 2014-06-10 08:21:04 +02:00
Jan Vansteenkiste 97326059d6 Updated the example gem with as little changes as possible
checksums.yaml.gz has been stripped as in the current gem.

Changes:

```diff
diff --git a/spec/fixtures/gem/example/example-1.0.gem b/spec/fixtures/gem/example/example-1.0.gem
index 0241779..9238a4a 100644
--- a/spec/fixtures/gem/example/example-1.0.gem
+++ b/spec/fixtures/gem/example/example-1.0.gem
@@ -46,10 +46,12 @@ dependencies:
         version: '0'
 description: sample description
 email: sample email
-executables: []
+executables:
+- example
 extensions: []
 extra_rdoc_files: []
-files: []
+files:
+- bin/example
 homepage: http://sample-url/
 licenses: []
 post_install_message:
@@ -78,3 +80,5 @@ test_files: []
 has_rdoc:
 ============== checksums =============
 =============== files ================
+bin/example
+#!/usr/bin/env ruby

```

See http://vstone.eu/diffing-gems-in-git/
2014-06-10 08:19:49 +02:00
Jan Vansteenkiste 43464f7990 Added tests. Rebuild of example-1.0.0.gem required though 2014-06-10 08:19:49 +02:00
Remi Hakim ffef1e762a Fix specs 2014-05-06 18:35:21 -04:00
Tom Duckering c5a2ad35d4 Merge branch 'master' of https://github.com/jordansissel/fpm 2014-05-06 12:41:45 +01:00
Jan Vansteenkiste b3bf553abd Added tests for commands without package -p <dir> 2014-05-05 18:51:02 +02:00
Adam Lamar 9bdd40ddec Support RPM dist tag
When --rpm-dist is specified, pass the dist tag to rpmbuild and
correctly name the file to ensure packages can be built with a
specific distribution in mind.
2014-05-01 18:33:49 +01:00
Dan Brown 6822e3bd50 Added support for dpkg triggers (fixes #595) 2014-05-01 14:43:54 +01:00
tduckeri a5cbda9db0 @tomduckering - adding a fix for the bug in the pessimistic constraint fixing for RPMs converted from Gems. 2014-05-01 14:30:46 +01:00
Dan Brown 3609a449a3 Added support for extra control files for debs (fixes #599) 2014-04-30 16:05:39 +01:00
Jordan Sissel dba0559d8a Support being given a directory for the output path (-p flag)
This should fix #656 and maybe a few other things.
2014-04-29 22:15:41 -07:00
Remi Hakim e7a9db50d4 Move logic in rpm specific places 2014-04-29 23:06:23 +02:00