Compare commits
No commits in common. "main" and "release-prep/1.17.0" have entirely different histories.
main
...
release-pr
|
|
@ -1,14 +1,6 @@
|
|||
# https://blog.readthedocs.com/build-errors-docutils-0-18/
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: ubuntu-24.04
|
||||
tools:
|
||||
python: "3.13"
|
||||
|
||||
sphinx:
|
||||
configuration: docs/conf.py
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
# Debian notes
|
||||
|
||||
## C libraries
|
||||
|
||||
Linux seems to require 'ldconfig' runs after shared libraries are installed. I
|
||||
haven't bothered digging into why, but many debian C library packages run
|
||||
ldconfig as a postinstall step.
|
||||
|
||||
I'd like to avoid postinstall actions, so this needs research to see if this is
|
||||
possible.
|
||||
|
||||
## Ruby
|
||||
|
||||
rubygems on Debian/Ubuntu is not very recent in most cases, and some gems have
|
||||
a requirement of rubygems >= a version you have available.
|
||||
|
||||
Further, debian blocks 'gem update --system' which you can get around by doing:
|
||||
|
||||
% gem install rubygems-update
|
||||
% ruby /var/lib/gems/1.8/gems/rubygems-update-1.3.1/bin/update_rubygems
|
||||
|
||||
I recommend packaging 'rubygems-update' (fpm -s gem -t deb rubygems-update) and
|
||||
possibly running the update_rubygems as a postinstall, even though I don't like
|
||||
postinstalls. I haven't looked yet to see what is required to mimic (if
|
||||
possible) the actions of that script simply in a tarball.
|
||||
|
||||
## Python
|
||||
|
||||
https://www.debian.org/doc/packaging-manuals/python-policy/ap-packaging_tools.html
|
||||
|
||||
Debian python packages all rely on some form of python-central or
|
||||
python-support (different tools that do similar/same things? I don't know)
|
||||
|
||||
As I found, disabling postinst scripts in Debian causes Python to stop working.
|
||||
The postinst scripts generally look like this:
|
||||
|
||||
if which update-python-modules >/dev/null 2>&1; then
|
||||
update-python-modules SOMEPACKAGENAME.public
|
||||
fi
|
||||
|
||||
I don't believe in postinst scripts, and I also feel like requiring a
|
||||
postinstall step to make a python module work is quite silly - though I'm sure
|
||||
(I hope) Debian had good reason.
|
||||
|
||||
So, I'm going to try working on a howto for recommended ways to build python
|
||||
packages with fpm in debian. It will likely require a one-time addition to
|
||||
site.py (/usr/lib/python2.6/site.py) or some other PYTHONPATH hackery, though
|
||||
I don't know just yet.
|
||||
|
||||
It will also require special setup.py invocations as Debian has patched distutils to
|
||||
install python packages, by default, to a place that requires again the
|
||||
python-central/support tools to run to make them work.
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
fpm
|
||||
===
|
||||
|
||||
|Gem|
|
||||
|Chat| |Gem|
|
||||
|
||||
The goal of fpm is to make it easy and quick to build packages such as rpms,
|
||||
debs, OSX packages, etc.
|
||||
|
|
@ -97,5 +97,7 @@ Targets:
|
|||
|
||||
.. include: docs/contributing
|
||||
|
||||
.. |Chat| image:: https://img.shields.io/badge/irc-%23fpm%20on%20freenode-brightgreen.svg
|
||||
:target: https://webchat.freenode.net/?channels=fpm
|
||||
.. |Gem| image:: https://img.shields.io/gem/v/fpm.svg
|
||||
:target: https://rubygems.org/gems/fpm
|
||||
|
|
|
|||
10
docs/conf.py
10
docs/conf.py
|
|
@ -28,9 +28,7 @@ import os
|
|||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx_rtd_theme'
|
||||
]
|
||||
extensions = []
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
|
@ -48,7 +46,7 @@ master_doc = 'index'
|
|||
|
||||
# General information about the project.
|
||||
project = u'fpm - packaging made simple'
|
||||
copyright = u'2025, Jordan Sissel and contributors'
|
||||
copyright = u'2016, Jordan Sissel'
|
||||
author = u'Jordan Sissel'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
|
|
@ -56,9 +54,9 @@ author = u'Jordan Sissel'
|
|||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'1.17'
|
||||
version = u'1.9'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'1.17.0'
|
||||
release = u'1.9.0'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ To make sure fpm is installed correctly, try running the following command::
|
|||
You should get some output like this, although the exact output will depend on which version of FPM you have installed.::
|
||||
|
||||
% fpm --version
|
||||
1.17.0
|
||||
1.14.0
|
||||
|
||||
Now you can go on to `using FPM! <getting-started.html>`_
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1,2 @@
|
|||
sphinx_rtd_theme
|
||||
# https://blog.readthedocs.com/build-errors-docutils-0-18/
|
||||
docutils<0.18
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
#!/usr/bin/env ruby
|
||||
$: << File.join(File.dirname(__FILE__), "..", "..", "lib")
|
||||
|
||||
# This example uses the API to create a package from local files
|
||||
# it also creates necessary init-scripts and systemd files so our executable can be used as a service
|
||||
|
||||
require "fpm"
|
||||
require "tmpdir"
|
||||
require "fpm/package/pleaserun"
|
||||
|
||||
# enable logging
|
||||
FPM::Util.send :module_function, :logger
|
||||
FPM::Util.logger.level = :info
|
||||
FPM::Util.logger.subscribe STDERR
|
||||
|
||||
package = FPM::Package::Dir.new
|
||||
|
||||
# Set some attributes
|
||||
package.name = "my-service"
|
||||
package.version = "1.0"
|
||||
|
||||
# Add a script to run after install (should be in the current directory):
|
||||
package.scripts[:after_install] = 'my_after_install_script.sh'
|
||||
|
||||
# Example for adding special attributes
|
||||
package.attributes[:deb_group] = "super-useful"
|
||||
package.attributes[:rpm_group] = "super-useful"
|
||||
|
||||
# Add our files (should be in the current directory):
|
||||
package.input("my-executable=/usr/bin/")
|
||||
package.input("my-library.so=/usr/lib/")
|
||||
|
||||
# Now, add our init-scripts, systemd services, and so on:
|
||||
pleaserun = package.convert(FPM::Package::PleaseRun)
|
||||
pleaserun.input ["/usr/bin/my-executable", "--foo-from", "bar"]
|
||||
|
||||
# Create two output packages!
|
||||
output_packages = []
|
||||
output_packages << pleaserun.convert(FPM::Package::RPM)
|
||||
output_packages << pleaserun.convert(FPM::Package::Deb)
|
||||
|
||||
# and write them both.
|
||||
begin
|
||||
output_packages.each do |output_package|
|
||||
output = output_package.to_s
|
||||
output_package.output(output)
|
||||
|
||||
puts "successfully created #{output}"
|
||||
end
|
||||
ensure
|
||||
# defer cleanup until the end
|
||||
output_packages.each {|p| p.cleanup}
|
||||
end
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
$: << File.join(File.dirname(__FILE__), "..", "..", "lib")
|
||||
require "fpm"
|
||||
|
||||
package = FPM::Package::Gem.new
|
||||
|
||||
# the Gem package takes a string name of the package to download/install.
|
||||
# Example, run this script with 'rails' as an argument and it will convert
|
||||
# the latest 'rails' gem into rpm.
|
||||
package.input(ARGV[0])
|
||||
rpm = package.convert(FPM::Package::RPM)
|
||||
begin
|
||||
output = "NAME-VERSION.ARCH.rpm"
|
||||
rpm.output(rpm.to_s(output))
|
||||
ensure
|
||||
rpm.cleanup
|
||||
end
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
$: << File.join(File.dirname(__FILE__), "..", "..", "lib")
|
||||
require "fpm"
|
||||
|
||||
package = FPM::Package::Gem.new
|
||||
ARGV.each do |gem|
|
||||
name, version = gem.split(/[=]/, 2)
|
||||
package.version = version # Allow specifying a specific version
|
||||
package.input(gem)
|
||||
end
|
||||
rpm = package.convert(FPM::Package::RPM)
|
||||
rpm.name = "rubygem-manythings"
|
||||
rpm.version = "1.0"
|
||||
begin
|
||||
output = "NAME-VERSION.ARCH.rpm"
|
||||
rpm.output(rpm.to_s(output))
|
||||
ensure
|
||||
rpm.cleanup
|
||||
end
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
#
|
||||
# feel free to change these to whatever makes sense
|
||||
#
|
||||
# debian package we rely on
|
||||
RUBY_PACKAGE=ruby
|
||||
# and the executable that comes from it
|
||||
RUBY_BIN=/usr/bin/ruby
|
||||
# the version we name the deb
|
||||
VERSION=1.1.0
|
||||
# where to get the sauce
|
||||
GIT_URL=https://github.com/jordansissel/fpm.git
|
||||
# the tag we checkout to build from
|
||||
TAG_SPEC=refs/tags/v$(VERSION)
|
||||
|
||||
CHECKOUT_DIR=fpm-checkout
|
||||
BUILD_DIR=build
|
||||
LIB_DIR=$(BUILD_DIR)/usr/lib/fpm
|
||||
BIN_DIR=$(BUILD_DIR)/usr/bin
|
||||
GEM_PATH:=$(shell readlink -f .)/build/gem
|
||||
FPM_BIN=$(BIN_DIR)/fpm
|
||||
BUNDLE_BIN=$(GEM_PATH)/bin/bundle
|
||||
BUNDLE_CMD=$(RUBY_CMD) $(BUNDLE_BIN)
|
||||
FPM_CMD=$(FPM_BIN)
|
||||
GEM_CMD=$(RUBY_BIN) -S gem
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(CHECKOUT_DIR)
|
||||
rm -rf $(BUILD_DIR)
|
||||
rm -f fpm*.deb
|
||||
|
||||
$(CHECKOUT_DIR):
|
||||
rm -rf $(CHECKOUT_DIR)
|
||||
git clone $(GIT_URL) $(CHECKOUT_DIR) --depth 1
|
||||
cd $(CHECKOUT_DIR) && git fetch && git checkout $(TAG_SPEC)
|
||||
|
||||
$(BUNDLE_BIN):
|
||||
$(GEM_CMD) install bundler --install-dir=$(GEM_PATH) --no-ri --no-rdoc
|
||||
|
||||
$(FPM_BIN):
|
||||
mkdir --parents $(BIN_DIR)
|
||||
# Couldn't think of a nice way to do this, so here is this code turd
|
||||
echo "#! $(RUBY_BIN)" > $(FPM_BIN)
|
||||
echo 'load File.dirname($$0) + "/../lib/fpm/bundle/bundler/setup.rb"' >> $(FPM_BIN)
|
||||
echo 'require "fpm"' >> $(FPM_BIN)
|
||||
echo 'require "fpm/command"' >> $(FPM_BIN)
|
||||
echo 'exit(FPM::Command.run || 0)' >> $(FPM_BIN)
|
||||
chmod +x $(FPM_BIN)
|
||||
|
||||
.PHONY: install
|
||||
install: $(CHECKOUT_DIR) $(BUNDLE_BIN) $(FPM_BIN)
|
||||
mkdir --parents $(LIB_DIR)
|
||||
cd $(CHECKOUT_DIR) && GEM_PATH=$(GEM_PATH) $(BUNDLE_CMD) install --without=development --standalone
|
||||
cd $(CHECKOUT_DIR) && gem build fpm.gemspec
|
||||
tar -xf $(CHECKOUT_DIR)/fpm*gem -C $(BUILD_DIR)
|
||||
tar --touch -xf $(BUILD_DIR)/data.tar.gz -C $(LIB_DIR)
|
||||
cp -r $(CHECKOUT_DIR)/bundle $(LIB_DIR)/bundle
|
||||
|
||||
.PHONY: package
|
||||
package: install
|
||||
$(FPM_BIN) -s dir -t deb -n fpm -d $(RUBY_PACKAGE) -v $(VERSION) -C $(BUILD_DIR) usr
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# About
|
||||
|
||||
- build and install dependency on a ruby1.9 of some kind
|
||||
- does not need root to package
|
||||
- has its own GEM_DIR to keep its dependencies isolated
|
||||
- installation does not install any gems in to your ruby environment
|
||||
- installs in to standard locations /usr/{bin,lib}/fpm
|
||||
- doesn't depend on having fpm installed for packaging to work
|
||||
|
||||
# Dependencies
|
||||
|
||||
- build-essential (perhaps more, but basically the standard packages you need
|
||||
for deb packaging)
|
||||
- ruby and ruby-dev
|
||||
|
||||
# Usage
|
||||
|
||||
- $ cd examples/fpm-with-system-ruby && make package
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
NAME=ruby
|
||||
VERSION=1.9.2-p180
|
||||
MAJOR_VERSION=1.9
|
||||
ARCHITECTURE=x86
|
||||
TARDIR=$(NAME)-$(VERSION)
|
||||
TARBALL=$(TARDIR).tar.gz
|
||||
DOWNLOAD=http://ftp.ruby-lang.org/pub/ruby/$(MAJOR_VERSION)/$(TARBALL)
|
||||
|
||||
PREFIX=/opt/fpm
|
||||
|
||||
PACKAGE_NAME=fpm
|
||||
PACKAGE_VERSION=0.2.30
|
||||
|
||||
.PHONY: default
|
||||
default: deb
|
||||
package: deb
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(NAME)-* $(NAME)_* |NAME| true
|
||||
rm -fr $(TARDIR) || true
|
||||
rm -fr $(PREFIX) || true
|
||||
rm -f *.deb
|
||||
|
||||
$(TARBALL):
|
||||
wget "$(DOWNLOAD)"
|
||||
|
||||
$(TARDIR): $(TARBALL)
|
||||
tar -zxf $(TARBALL)
|
||||
cd $(TARDIR); ./configure --enable-shared=false --prefix=$(PREFIX); make; make install
|
||||
$(PREFIX)/bin/gem install fpm
|
||||
|
||||
.PHONY: deb
|
||||
deb: $(TARDIR)
|
||||
$(PREFIX)/bin/fpm -s dir -t deb -v $(PACKAGE_VERSION) -n $(PACKAGE_NAME) -a $(ARCHITECTURE) -C $(PREFIX) .
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
Notes:
|
||||
|
||||
You should have write permission on /opt directory
|
||||
|
||||
Dependencies:
|
||||
|
||||
$ sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libxml2-dev libxslt-dev autoconf libc6-dev
|
||||
|
||||
Usage:
|
||||
|
||||
$ make package
|
||||
|
||||
Should make the package. Try installing:
|
||||
|
||||
$ sudo dpkg -i fpm-0.2.30.x86.deb
|
||||
|
||||
Now try it:
|
||||
|
||||
$ /opt/fpm/bin/fpm --help
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
NAME=jruby
|
||||
VERSION=1.6.1
|
||||
DOWNLOAD=http://jruby.org.s3.amazonaws.com/downloads/$(VERSION)/$(TARBALL)
|
||||
TARBALL=$(NAME)-bin-$(VERSION).tar.gz
|
||||
TARDIR=$(NAME)-$(VERSION)
|
||||
|
||||
PREFIX=/opt/jruby
|
||||
|
||||
.PHONY: default
|
||||
default: deb
|
||||
package: deb
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(NAME)-* $(NAME)_* || true
|
||||
rm -fr $(TARDIR) || true
|
||||
rm -f *.deb
|
||||
rm -f *.rpm
|
||||
|
||||
$(TARBALL):
|
||||
wget "$(DOWNLOAD)"
|
||||
|
||||
$(TARDIR): $(TARBALL)
|
||||
tar -zxf $(TARBALL)
|
||||
|
||||
.PHONY: deb
|
||||
deb: $(TARDIR)
|
||||
fpm -s dir -t deb -v $(VERSION) -n $(NAME) -d "sun-java6-bin (>> 0)" \
|
||||
-a all -d "sun-java6-jre (>> 0)" --prefix $(PREFIX) -C $(TARDIR) .
|
||||
|
||||
.PHONY: rpm
|
||||
rpm: $(TARDIR)
|
||||
fpm -s dir -t rpm -v $(VERSION) -n $(NAME) -d "jdk >= 1.6.0" \
|
||||
-a all --prefix $(PREFIX) -C $(TARDIR) .
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
Usage:
|
||||
|
||||
make package
|
||||
|
||||
Should make the package. Try installing:
|
||||
|
||||
sudo dpkg -i jruby-1.6.0.RC2-1.all.deb
|
||||
|
||||
Now try it:
|
||||
|
||||
% /opt/jruby/bin/jirb
|
||||
>> require "java"
|
||||
=> true
|
||||
>> java.lang.System.out.println("Hello")
|
||||
Hello
|
||||
=> nil
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
NAME=twisted
|
||||
VERSION=10.2.0
|
||||
|
||||
twisted:
|
||||
easy_install --editable --build-directory . "$(NAME)==$(VERSION)"
|
||||
|
||||
usr: twisted
|
||||
cd twisted; python setup.py bdist
|
||||
tar -zxf twisted/dist/Twisted-$(VERSION).linux-$(shell uname -m).tar.gz
|
||||
|
||||
package: usr
|
||||
fpm -s dir -t deb -n $(NAME) -v $(VERSION) \
|
||||
-p python-$(NAME)-VERSION_ARCH.deb -d "python" \
|
||||
usr
|
||||
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
module FPM
|
||||
VERSION = "1.17.0"
|
||||
VERSION = "1.17.0.pre1"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ ! -f "mk/bsd.pkg.mk" ] ; then
|
||||
# TODO(sissel): Maybe download pkgsrc ourselves.
|
||||
echo "Current directory doesn't appear to be a pkgsrc tree. ($PWD)"
|
||||
echo "I was expecting to find file: ./mk/bsd.pkg.mk"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "build/usr/local/bin/bmake" ] ; then
|
||||
# TODO(sissel): Maybe bootstrap ourselves.
|
||||
echo "This script requires pkgsrc to be bootstrapped in a specific way."
|
||||
echo "I expected to find file: build/usr/local/bin/bmake and did not"
|
||||
echo
|
||||
echo "Bootstrap with:"
|
||||
echo "SH=/bin/bash ./bootstrap/bootstrap --unprivileged --prefix $PWD/build/usr/local --pkgdbdir $PWD/pkgdb"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# TODO(sissel): put some flags.
|
||||
|
||||
LOCALBASE="/usr/local"
|
||||
DESTDIR=$PWD/build
|
||||
|
||||
mkdir -p "$DESTDIR"
|
||||
|
||||
export PATH=$DESTDIR/$LOCALBASE/bin:$DESTDIR/$LOCALBASE/sbin:$PATH
|
||||
|
||||
for i in "$@" ; do
|
||||
# process dependencies first before the final target.
|
||||
set -- $(bmake -C "$@" show-depends-pkgpaths) "$@"
|
||||
done
|
||||
|
||||
TARGETS="$*"
|
||||
|
||||
for target in $TARGETS; do
|
||||
set --
|
||||
|
||||
eval "$(bmake -C $target show-vars-eval VARS="PKGNAME PKGVERSION")"
|
||||
name="$(echo "$PKGNAME" | sed -e "s/-$PKGVERSION\$//")"
|
||||
orig_version=${PKGVERSION}
|
||||
version=${PKGVERSION}-pkgsrc
|
||||
|
||||
# Purge old package
|
||||
rm packages/All/$PKGNAME.tgz
|
||||
|
||||
pkg_delete $name > /dev/null 2>&1
|
||||
|
||||
bmake -C $target clean || exit 1
|
||||
bmake -C $target USE_DESTDIR=yes LOCALBASE=$LOCALBASE PREFIX=$LOCALBASE \
|
||||
DESTDIR=$DESTDIR SKIP_DEPENDS=yes \
|
||||
clean package || exit 1
|
||||
|
||||
# Start building fpm args
|
||||
set -- -n "$name" -v "$version" --prefix $LOCALBASE
|
||||
|
||||
# Skip the pkgsrc package metadata files
|
||||
set -- "$@" --exclude '+*'
|
||||
|
||||
# Handle deps
|
||||
for dep in $(bmake -C $target show-depends-pkgpaths) ; do
|
||||
eval "$(bmake -C $dep show-vars-eval VARS="PKGNAME PKGVERSION")"
|
||||
PKGNAME="$(echo "$PKGNAME" | sed -e "s/-$PKGVERSION\$//")"
|
||||
set -- "$@" -d "$PKGNAME (= $PKGVERSION-pkgsrc)"
|
||||
done
|
||||
|
||||
set -- -s tar -t deb "$@"
|
||||
set -- "$@" packages/All/$name-$orig_version.tgz
|
||||
fpm "$@"
|
||||
done
|
||||
|
||||
|
||||
Loading…
Reference in New Issue