Commit Graph

2296 Commits

Author SHA1 Message Date
Jordan Sissel 5d2b4854d3 Fix failing test.
Looks like at some point django changed the admin tool from
"django-admin" to "django-admin.py"

Possibly this changed in upstream in Django on this commit, though I
don't know for certain:
85efc14a2e
2022-05-01 21:53:54 -07:00
Jordan Sissel 7f4718f9c2 Run `pip` without the `--build` flag
Previously, fpm would use `pip download ... --build ...` to instruct pip
to unpack a given python package to a specific directory for the purpose
of running something like `python setup.py` from it.

However, somewhere in 2021, pip removed this flag. First, I think, it
was deprecated and ignored, then finally removed. One reference to
this removal in the upstream pip project is this issue:
https://github.com/pypa/pip/issues/8333

Without `--build`, pip will place a single tarball in the destination
directory. Fpm cannot easily predict the name of this file because we
don't know the "real" name of the python package nor do we know the
version number being downloaded.

For example:

```
% python3 -m pip download --no-binary :all: --no-deps --no-clean django
...
Successfully downloaded django
% ls
Django-4.0.4.tar.gz
```

Best guess:
* we can expect exactly one file in the previously-empty target directory
* we can also expect that it is a .tar.gz

I don't know if these guesses are always correct, but it's a start.

As of this commit, the following command generates a Debian package:

`fpm -s python --python-bin python3 -t deb django`

Prior to this commit, with a newer version of pip, the command would
fail.

Fixes #1831
2022-05-01 21:53:54 -07:00
Jordan Sissel 82284c7a4b Rerun `make release-prep` 2022-03-31 00:15:23 -07:00
Jordan Sissel 60b4bd30b3 Add additional changelog entries 2022-03-31 00:09:25 -07:00
Jordan Sissel 377fcaf871 Add note about new documentation pages 2022-03-31 00:09:25 -07:00
Jordan Sissel 2943d82581 Version bump and update changelog 2022-03-31 00:09:25 -07:00
mszprejda f5d07520b7 pacman.rb: Fix typo in compression type matching 2022-03-30 23:52:51 -07:00
Jordan Sissel 0dfe21bab7 Add test case for files with spaces and quotatation marks.
Testing, this new test case fails on v1.14.1 and *succeeds* as expected
after #1882 was merged.

Fixes #1886
2022-03-30 23:50:55 -07:00
John Bollinger b2ba5c4a59 Fix filename mangling for RPM targets
Fixes the mangling FPM performs on the contents of RPM %files lists
to better match RPM's idiosyncratic filename handling.  FPM now
recognizes more cases that require special handling, and it
correctly distinguishes between the glob and non-glob cases,
which RPM itself treates differently.

Fixes #1385
2022-03-30 23:47:02 -07:00
Jordan Sissel 521d030420 Fix reStructuredText header length syntax 2022-03-30 23:15:59 -07:00
Jordan Sissel 106828fc12 Add description in header 2022-03-30 23:15:59 -07:00
Jordan Sissel 0c84173de0 Add description in header 2022-03-30 23:15:59 -07:00
Jordan Sissel 9b9a1b365f Add very basic package docs for each type of package.
Thanks to @alanc and _msw_ for quickly helping me figure out good words
to write to describe Solaris' p5p format.

For #1884.
2022-03-30 23:15:59 -07:00
John Howard eb5370d16e Fix `--deb-compression none`
Previously, we would pass the literal `""` as an argument to `tar`.
`tar` would interpret this as a file name, which does not exist, and
fail.

This fixes the command to just pass no compression flag at all to tar
when `--deb-compression none` is set.

I did not add tests since I couldn't figure out how to execute them -
this is my first time working in ruby.
2022-03-21 15:20:08 -07:00
Jordan Sissel 92886d922d Restore development_dependency on `rake`
A prior commit removed `rake` as a development dependency on the
assumption that nothing in fpm's development process actually required
the use of `rake`.

However, I had forgotten about #756 (year 2014) which adds FPM::RakeTask
and some test coverage. FPM::RakeTask was added to allow folks to more
easily invoke FPM from within a Rake task.

At this time, I see no reason to remove FPM::RakeTask. Further, because
`rake` is typically (in my experience) used only in development
environments. Therefore, I believe the right solution is to restore
`rake` as a development_dependency in order to allow the test suite to
pass. For users of FPM::RakeTask, I would assume (hopefully correctly!)
that they already have `rake` installed as a dependency in their own
project, so the `fpm` gem has no need to specify `rake` as a general-use
dependency.

When studying newer versions of Rake, I found:
* Rake v13 requires Ruby 2.2 or newer.
* Rake v12.xx and older are flagged as having security vulnerabilities.

In order to minimize chaos, this commit adds an unversioned dependency
on rake. This is to help fpm service more versions of Ruby and resist
efforts by any dependency to dictate which version of Ruby is used.

This reverts db9db670c3.

Fixes #1877
2022-02-23 18:04:51 -08:00
Corey Quinn 9aa1c1cb64 Update README to modernize the given example. 2022-02-07 15:26:36 -08:00
Geoff Beier 7a1302d1e8 fix typo in "perl" 2022-01-26 12:22:04 -08:00
Jordan Sissel 53f669219c Version bump 2021-11-10 15:01:34 -08:00
Jordan Sissel 20e754adfb Update changelog after #1854 was fixed. 2021-11-10 15:01:04 -08:00
Jordan Sissel d819e59a80 Require fpm/package/dir to make FPM::Package::Dir available (for #1854) 2021-11-10 14:58:50 -08:00
Jordan Sissel 021fc45047 Add requires so that other package types are available
When converting, we check if the original package was of a certain type.
In order for those types/constants to be available, we have to require
those files.

Test cases which now work correctly with this commit, but had failed
prior:

    % bundle exec ruby -r./lib/fpm/package/rpm.rb -e 'FPM::Package::RPM.new.tap { |x| x.name = "fancy" }.convert(FPM::Package::RPM)'
    % bundle exec ruby -r./lib/fpm/package/deb.rb -e 'FPM::Package::Deb.new.tap { |x| x.name = "fancy" }.convert(FPM::Package::Deb)'

Fixes #1854
2021-11-10 14:58:50 -08:00
Jordan Sissel 121989e0a0 Version bump 2021-11-09 22:30:01 -08:00
Jordan Sissel bba3114075 Regenerate in prep for release 2021-11-09 22:29:16 -08:00
Jordan Sissel 329b4758a6 Also regen per-package-type cli pages 2021-11-09 22:29:06 -08:00
Jordan Sissel 5b8e9fc334 Add release-prep target to regenerate certain files 2021-11-09 22:28:20 -08:00
Jordan Sissel 23c5790ec4 Update version in docs. Also fix link 2021-11-09 22:28:04 -08:00
Jordan Sissel d5985a5571 Fix sphinx error about empty block. 2021-11-09 22:27:50 -08:00
Jordan Sissel f722c4b3f5 Add introduction for the landing page. 2021-11-09 22:27:24 -08:00
Jordan Sissel 8437e50fe0 Update changelog from v1.13.1 to now 2021-11-09 22:27:14 -08:00
Jordan Sissel d43a017736 Have pip download packages to the build_path
Prior to this change, pip would download Python packages to $PWD which
leaves files hanging around.

The build_path is automatically removed when fpm exits.
2021-11-09 21:29:41 -08:00
Jordan Sissel c1930fc465 Try to find the right python executable. Also don't require easy_install anymore.
As part of making "internal pip" the default (#1820), the test suite
needed two main changes:
1) Don't check for easy_install anymore
2) Try to find the right python executable.

On my Ubuntu 20.04 system, installing Python gives Python v3 which only
makes the "python3" executable available. To compensate, the test suite
now tries to find any of "python", "python2", or "python3" to use with
the test suite. When found, it will set the appropriate `--python-bin`
flag in fpm for each test.

For #1820
2021-11-09 21:29:41 -08:00
Jordan Sissel 7b57e92ec4 Cite reason for using 'python -m pip' aka "internal pip"
* https://bugs.python.org/issue22295

At time of writing, the python 3 installation docs mention:

https://docs.python.org/3/installing/index.html

> The following command will install the latest version of a module and its dependencies from the Python Package Index:
>
> python -m pip install SomePackage
2021-11-09 21:29:41 -08:00
Jordan Sissel 9e3f75b628 By default, use pip for fetching and installing python packages.
This adds a new flag, --python-internal-pip, which is enabled by default.

"internal pip" means using 'python -m pip' to invoke pip. Ideally this will make fpm more correctly use pip.

Tested on python 2.7.17 and 3.6.9 on Ubuntu 18.04

All python tests passing 👍👍

Fixes #1820
2021-11-09 21:29:41 -08:00
Jordan Sissel 309e6b3c18 Only show /etc "config files" warning when files are present in /etc.
This should silence a warning in cases when packages do not contain any
/etc files. Prior to this commit, most debian package creation would
have this warning emitted:

```
Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {:level=>:warn}
```

Fixes #1851
2021-11-09 21:10:34 -08:00
Jordan Sissel 052656b480 'empty' packages now default to "all" architecture.
This feels like the right default because empty packages have no files
(especially no binary, architecture-specific files) and therefore should
be installable on any architecture.

Fixes #1846
2021-11-09 21:02:17 -08:00
Jordan Sissel 809c726944 Use correct constant name 2021-11-09 16:47:02 -08:00
seph d69e648ce0 Skip tests which cannot be run due to missing dependencies.
Also fix at a failing deb lintian test which was failing due to a
missing 'lsb-base' dependency
2021-11-09 16:47:02 -08:00
seph 62f1418e4a Add documentation for running fpm from docker
Also add documentation for running the fpm test suite in docker.

From #1681
2021-11-09 16:47:02 -08:00
seph e1ef157dc3 fpm tests can now be run through docker.
This changes the Dockerfile to create docker images suitable for running tests (fpm rspec suite in docker) and also as a normal release (using fpm through docker).

Fixes #1682, #1453
2021-11-09 16:47:02 -08:00
Jordan Sissel db9db670c3 Remove rake development_dependency. I don't think Rake is used for fpm development ;) 2021-11-09 16:34:27 -08:00
Jordan Sissel 58ddeda91b Apply fix for readthedocs building errors.
https://blog.readthedocs.com/build-errors-docutils-0-18/

For #1848

Hoping this fixes it. Readthedocs emails me whenever doc build fails, and
for the past week or two, it has said the following:

```
Running Sphinx v1.8.5
loading translations [en]... done
making output directory...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 37 source files that are out of date
updating environment: 37 added, 0 changed, 0 removed
reading sources... [  2%] changelog
reading sources... [  5%] changelog_links
reading sources... [  8%] cli-reference

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/fpm/envs/latest/lib/python2.7/site-packages/sphinx/cmd/build.py", line 304, in build_main
    app.build(args.force_all, filenames)
[ ... cut for brevity ... ]
  File "/home/docs/checkouts/readthedocs.org/user_builds/fpm/envs/latest/lib/python2.7/site-packages/sphinx/util/nodes.py", line 94, in apply_source_workaround
    for classifier in reversed(node.parent.traverse(nodes.classifier)):
TypeError: argument to reversed() must be a sequence
```
2021-11-09 15:52:31 -08:00
Jordan Sissel 11646b943f Add cpan docs per #1838 2021-11-09 15:44:37 -08:00
Jordan Sissel 13621c9722 Add special handling for converting CPAN to Deb.
I needed found this issue while trying to write documentation and
examples for fpm's cpan support. Fpm was generating invalid debian
packages as a result! This should fix things.
2021-11-09 15:44:37 -08:00
Jordan Sissel c6baaf9427 Fix formatting typo. Needed '::' to make the next paragraph pre-formatted code 2021-11-09 15:44:37 -08:00
Jordan Sissel 9efd56c54a Add npm/nodejs package documentation
This example uses the `ascii-art` npm package. I have realized that
using this package with its example ascii art is likely not accessible
for screen readers. I'll keep the example for now and revise it later.
2021-11-09 15:44:37 -08:00
Jordan Sissel 3540cfeb4b Add `dir` docs
For #1838
2021-11-09 15:44:37 -08:00
Jordan Sissel cb24061992 Fix formatting and rpm examples. 2021-11-09 15:44:37 -08:00
Jordan Sissel d6a77bff2a Add docs for 'empty' package type 2021-11-09 15:44:37 -08:00
Jordan Sissel e8fb21d725 Move generated cli docs to packages/cli/{type}.rst
I'm hoping this makes it easier to find files in the docs/packages
directory.
2021-11-09 15:44:37 -08:00
Jordan Sissel aecf23801d Add 'make view' in the docs/Makefile. Live-reloading sphinx html build.
Use sphinx-autobuild to run a server which autobuilds and reloads docs
in the browser.
2021-11-09 15:44:37 -08:00