mirror of
https://github.com/trapexit/mergerfs.git
synced 2024-11-22 10:22:02 +08:00
add building of rpm
This commit is contained in:
parent
ce2462042f
commit
08d07b71e1
23
Makefile
23
Makefile
|
@ -33,11 +33,14 @@ INSTALL = $(shell which install)
|
|||
MKTEMP = $(shell which mktemp)
|
||||
STRIP = $(shell which strip)
|
||||
PANDOC = $(shell which pandoc)
|
||||
SED = $(shell which sed)
|
||||
GZIP = $(shell which gzip)
|
||||
RPMBUILD = $(shell which rpmbuild)
|
||||
GIT2DEBCL = ./tools/git2debcl
|
||||
CPPFIND = ./tools/cppfind
|
||||
|
||||
ifeq ($(PKGCONFIG),"")
|
||||
$(error "pkg-config not installed"
|
||||
$(error "pkg-config not installed")
|
||||
endif
|
||||
|
||||
ifeq ($(PANDOC),"")
|
||||
|
@ -122,7 +125,7 @@ obj/obj-stamp:
|
|||
obj/%.o: src/%.cpp
|
||||
$(CXX) $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
clean: rpm-clean
|
||||
$(RM) -rf obj
|
||||
$(RM) -f "$(TARGET)" "$(MANPAGE)" clonepath
|
||||
$(FIND) . -name "*~" -delete
|
||||
|
@ -162,11 +165,12 @@ man: $(MANPAGE)
|
|||
|
||||
tarball: clean man changelog authors
|
||||
$(eval VERSION := $(shell $(GIT) describe --always --tags --dirty))
|
||||
$(eval VERSION := $(subst -,_,$(VERSION)))
|
||||
$(eval FILENAME := $(TARGET)-$(VERSION))
|
||||
$(eval TMPDIR := $(shell $(MKTEMP) --tmpdir -d .$(FILENAME).XXXXXXXX))
|
||||
$(MKDIR) $(TMPDIR)/$(FILENAME)
|
||||
$(CP) -ar . $(TMPDIR)/$(FILENAME)
|
||||
$(TAR) --exclude=.git -cz -C $(TMPDIR) -f ../$(FILENAME).tar.gz $(FILENAME)
|
||||
$(TAR) --exclude=.git -cz -C $(TMPDIR) -f $(FILENAME).tar.gz $(FILENAME)
|
||||
$(RM) -rf $(TMPDIR)
|
||||
|
||||
debian-changelog:
|
||||
|
@ -178,6 +182,19 @@ deb: debian-changelog
|
|||
unsigned-deb: debian-changelog
|
||||
dpkg-buildpackage -uc -us
|
||||
|
||||
rpm-clean:
|
||||
$(RM) -rf rpmbuild
|
||||
|
||||
rpm: tarball
|
||||
$(eval VERSION := $(shell $(GIT) describe --always --tags --dirty))
|
||||
$(eval VERSION := $(subst -,_,$(VERSION)))
|
||||
$(MKDIR) -p rpmbuild/{BUILD,RPMS,SOURCES}
|
||||
$(SED) 's/__VERSION__/$(VERSION)/g' $(TARGET).spec > \
|
||||
rpmbuild/SOURCES/$(TARGET).spec
|
||||
cp -ar $(TARGET)-$(VERSION).tar.gz rpmbuild/SOURCES
|
||||
$(RPMBUILD) -ba rpmbuild/SOURCES/$(TARGET).spec \
|
||||
--define "_topdir $(CURDIR)/rpmbuild"
|
||||
|
||||
.PHONY: all clean install help
|
||||
|
||||
include $(wildcard obj/*.d)
|
||||
|
|
|
@ -121,7 +121,9 @@ $ sudo dpkg -i ../mergerfs_version_arch.deb
|
|||
```
|
||||
$ su -
|
||||
# dnf install fuse-devel libattr-devel pandoc gcc-c++
|
||||
# make install
|
||||
# cd mergerfs
|
||||
# make rpm
|
||||
# rpm -i rpmbuild/RPMS/<arch>/mergerfs-<verion>.<arch>.rpm
|
||||
```
|
||||
|
||||
#### Generically
|
||||
|
|
50
mergerfs.spec
Normal file
50
mergerfs.spec
Normal file
|
@ -0,0 +1,50 @@
|
|||
Name: mergerfs
|
||||
Version: __VERSION__
|
||||
Release: 1%{?dist}
|
||||
Summary: A FUSE union filesystem
|
||||
|
||||
Group: Applications/System
|
||||
License: MIT
|
||||
URL: https://github.com/trapexit/mergerfs
|
||||
|
||||
Source: mergerfs-%{version}.tar.gz
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libattr-devel
|
||||
BuildRequires: fuse-devel
|
||||
# rpmbuild driven by the Makefile uses git to generate a version number
|
||||
BuildRequires: git
|
||||
# pandoc pulls in ~60 packages (87M installed) from EPEL :(
|
||||
BuildRequires: pandoc
|
||||
|
||||
Requires: fuse-libs
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%description
|
||||
mergerfs is similar to mhddfs, unionfs, and aufs. Like mhddfs in that it too
|
||||
uses FUSE. Like aufs in that it provides multiple policies for how to handle
|
||||
behavior.
|
||||
|
||||
%build
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
make install PREFIX=%{_prefix} DESTDIR=%{buildroot}
|
||||
|
||||
%files
|
||||
%{_bindir}/*
|
||||
%doc %{_mandir}/*
|
||||
|
||||
%changelog
|
||||
* Sat Sep 05 2015 Antonio SJ Musumeci <trapexit@spawn.link>
|
||||
- Include PREFIX to install
|
||||
|
||||
* Mon Dec 29 2014 Joe Lawrence <joe.lawrence@stratus.com>
|
||||
- Tweak rpmbuild to archive current git HEAD into a tarball, then (re)build in
|
||||
the rpmbuild directory -- more complicated but seemingly better suited to
|
||||
generate source and debug rpms.
|
||||
|
||||
* Fri Jun 20 2014 Joe Lawrence <joe.lawrence@stratus.com>
|
||||
- Initial rpm spec file.
|
Loading…
Reference in New Issue
Block a user