-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from 45Drives/package-el8
Package el8
- Loading branch information
Showing
7 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM centos:8 | ||
|
||
LABEL description="Container in which to build el8 applications" | ||
|
||
ENV TZ=America/Glace_Bay | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
|
||
RUN dnf group install -y "Development Tools" | ||
RUN dnf install -y rpm-build rpm-devel rpmlint make python3 bash diffutils patch rpmdevtools boost-devel tbb-devel gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ fuse3-devel | ||
ENV PATH=/opt/rh/gcc-toolset-9/root/usr/bin:$PATH | ||
|
||
# install powertools | ||
RUN dnf install -y dnf-plugins-core | ||
RUN dnf config-manager -y --set-enabled powertools | ||
|
||
# install rocksdb devel | ||
RUN dnf install -y gflags gflags-devel snappy snappy-devel zlib zlib-devel bzip2 bzip2-devel lz4-devel libzstd-devel wget boost-static lz4-libs zlib-static | ||
RUN wget https://github.com/facebook/rocksdb/archive/v6.1.2.zip && \ | ||
unzip v6.1.2.zip && \ | ||
cd rocksdb-6.1.2 && \ | ||
PORTABLE=1 DISABLE_WARNING_AS_ERROR=1 make -j8 static_lib && \ | ||
INSTALL_PATH=/usr make install-static && \ | ||
cd .. && \ | ||
rm -rf rocksdb-6.1.2 v6.1.2.zip | ||
|
||
RUN mkdir -p /home/rpm/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS,tmp} | ||
|
||
RUN echo %_topdir /home/rpm/rpmbuild > /etc/rpm/macros | ||
RUN echo %_tmppath %{_topdir}/tmp >> /etc/rpm/macros | ||
|
||
RUN chmod -R 777 /home/rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
%define __spec_install_post %{nil} | ||
%define debug_package %{nil} | ||
%define __os_install_post %{_dbpath}/brp-compress | ||
|
||
Name: autotier | ||
Version: 1.1.3 | ||
Release: 1%{?dist} | ||
Summary: Tiered FUSE Passthrough Filesystem | ||
|
||
License: GPL-3.0+ | ||
URL: github.com/45drives/autotier/blob/master/README.md | ||
Source0: %{name}-%{version}.tar.gz | ||
|
||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root | ||
|
||
%description | ||
A passthrough FUSE filesystem that intelligently moves files | ||
between storage tiers based on frequency of use, file age, and tier fullness. | ||
|
||
%prep | ||
%setup -q | ||
|
||
%build | ||
make EXTRA_CFLAGS="-DEL8" EXTRA_LIBS="-lz -lzstd -llz4 -lbz2 -lsnappy" -j8 | ||
|
||
%install | ||
make DESTDIR=%{buildroot} PACKAGING=1 install | ||
|
||
%clean | ||
make DESTDIR=%{buildroot} clean | ||
|
||
%files | ||
%defattr(-,root,root,-) | ||
%config %{_sysconfdir}/autotier.conf | ||
%{_bindir}/* | ||
/opt/45drives/%{name}/* | ||
%docdir /usr/share/man/man8 | ||
%doc /usr/share/man/man8/* | ||
/usr/share/bash-completion/completions/* | ||
|
||
%post | ||
groupadd -f autotier | ||
|
||
%changelog | ||
* Thu Apr 08 2021 Josh Boudreau <[email protected]> 1.1.3.-1 | ||
- First EL8 build. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright (C) 2019-2021 Joshua Boudreau <[email protected]> | ||
# | ||
# This file is part of autotier. | ||
# | ||
# autotier is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# autotier is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with autotier. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
./package-deb.sh && ./package-el8.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright (C) 2019-2021 Joshua Boudreau <[email protected]> | ||
# | ||
# This file is part of autotier. | ||
# | ||
# autotier is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# autotier is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with autotier. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
TMP_DIR=/tmp/autotier | ||
|
||
if [[ "$#" == 1 && "$1" == "clean" ]]; then | ||
rm -rf $TMP_DIR | ||
rm -rf dist/el8 | ||
exit 0 | ||
fi | ||
|
||
command -v docker > /dev/null 2>&1 || { | ||
echo "Please install docker."; | ||
exit 1; | ||
} | ||
|
||
# if docker image DNE, build it | ||
if [[ "$(docker images -q autotier-el8-builder 2> /dev/null)" == "" ]]; then | ||
docker build -t autotier-el8-builder - < docker/el8 | ||
res=$? | ||
if [ $res -ne 0 ]; then | ||
echo "Building docker image failed." | ||
exit $res | ||
fi | ||
fi | ||
|
||
make clean | ||
|
||
mkdir -p dist/el8 | ||
mkdir -p $TMP_DIR | ||
|
||
# Tar up source | ||
SOURCE_NAME=autotier-$(grep Version el8/autotier.spec --color=never | awk '{print $2}') | ||
SOURCE_PATH=$TMP_DIR/$SOURCE_NAME | ||
mkdir -p $SOURCE_PATH | ||
SOURCE_LOC="$(dirname "$SOURCE_PATH")" | ||
|
||
cp -r src/ makefile doc/ $SOURCE_PATH | ||
|
||
pushd $SOURCE_LOC | ||
tar -czvf $SOURCE_NAME.tar.gz $SOURCE_NAME | ||
popd | ||
|
||
# build rpm from source tar and place it dist/el8 by mirroring dist/el8 to rpmbuild/RPMS | ||
docker run -u $(id -u):$(id -g) -w /home/rpm/rpmbuild -it -v$SOURCE_LOC:/home/rpm/rpmbuild/SOURCES -v$(pwd)/dist/el8:/home/rpm/rpmbuild/RPMS -v$(pwd)/el8:/home/rpm/rpmbuild/SPECS --rm autotier-el8-builder rpmbuild -ba SPECS/autotier.spec | ||
res=$? | ||
if [ $res -ne 0 ]; then | ||
echo "Packaging failed." | ||
exit $res | ||
fi | ||
|
||
rm -rf $SOURCE_LOC | ||
|
||
echo "rpm is in dist/el8/" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters