Added rpm build script ( Untested. )

This commit is contained in:
GeigerCounter 2017-03-28 13:37:41 -04:00
parent 2e6cbcb362
commit edee53f6f2
3 changed files with 148 additions and 1 deletions

56
assets/packaging/micro.1 Normal file
View File

@ -0,0 +1,56 @@
.\" micro manual page - micro(1)
.\"
.\" Copyright © 2017 Zachary Yedidia <zyedidia@gmail.com>
.\" Copyright © 2017 Collin Warren <anatoly@somethinghub.com>
.\"
.\" This document is provided under the same licensing as micro.
.\" See \usr\share\doc\micro\LICENSE for more information.
.TH micro 1 "2017-03-28"
.SH NAME
micro \- An intuitive and modern terminal text editor
.
.SH SYNOPSIS
.B micro
.RB []
[
.I "filename \&..."
]
.SH DESCRIPTION
( Copied from the README file. )
Micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the full capabilities
of modern terminals. It comes as one single, batteries-included, static binary with no dependencies.
As the name indicates, micro aims to be somewhat of a successor to the nano editor by being easy to install and use in a pinch, but micro also aims to be
enjoyable to use full time, whether you work in the terminal because you prefer it (like me), or because you need to (over ssh).
.SH OPTIONS
.B \-v --version
Displays the current version of micro and the git commit hash.
.TP
.SH ENVIRONMENT
Micro's behaviour can be changed by setting environment variables, of which
there is currently only one:
.I MICRO_TRUE_COLOR
When MICRO_TRUE_COLOR is set to 1, micro will attempt to treat your terminal as
a true-color terminal and will be able to make full use of the true-color colorschemes
that are included with micro. If MICRO_TRUE_COLOR is not set or is set to 0, then
micro will only make use of 256 color features and will internally map true-color
colorschemes to the nearest colors available. For more information see micro's documentation.
.SH NOTICE
This manpage is intended only to serve as a quick guide to the invocation of
micro and is not intended to replace the full documentation included with micro
which can be accessed from within micro. Micro tells you what key combination to
press to get help in the lower right.
.SH BUGS
A comprehensive list of bugs will not be listed in this manpage. See the Github
page at \fBhttps://github.com/zyedidia/micro/issues\fP for a list of known bugs
and to report any newly encountered bugs you may find. We strive to correct
bugs as swiftly as possible.
.SH COPYRIGHT
Copyright \(co 2017 Zachary Yedidia, Collin Warren, et al.
See /usr/share/doc/micro/LICENSE and /usr/share/doc/micro/AUTHORS for more information.

View File

@ -24,6 +24,9 @@ function installFiles() {
cp ../LICENSE $TO
cp ../LICENSE-THIRD-PARTY $TO
cp ../README.md $TO
gzip -c ../assets/packaging/micro.1 > $1/$2/usr/share/man/man1/micro.1.gz
cp ../assets/packaging/micro.desktop $1/$2/usr/share/applications/
cp ../assets/logo.svg $1/$2/usr/share/icons/micro.svg
}
version=$1
@ -39,7 +42,7 @@ echo "Beginning package build process"
PKGPATH="../packages/deb"
rm -fr ../packages
rm -fr $PKGPATH
mkdir -p $PKGPATH/amd64/DEBIAN/
mkdir -p $PKGPATH/i386/DEBIAN/

88
tools/build-rpm.sh Executable file
View File

@ -0,0 +1,88 @@
#Builds two .rpm packages, for x86 (i386) and amd64 (amd64)
#Based on the build-deb.sh but for rpm instead
function BuildRPMSpec() {
dategenerated = date +%F_%H:%M
echo Name: micro
echo Version: $2
echo Release: 1
echo "Summary: A feature-rich terminal text editor"
echo URL: https://micro-editor.github.io
echo "Packager: Zachary Yedidia <zyedidia@gmail.com>"
echo License: MIT
echo ExclusiveArch: $1
echo "Group: Applications/Editors"
echo "%description"
echo "A modern and intuitive terminal-based text editor."
echo " This package contains a modern alternative to other terminal-based"
echo " Editors. It is easy to use, supports mouse input, and is customizable"
echo " via themes and plugins."
echo "%install"
echo "mkdir -p /usr/share/doc/micro"
echo "install -m 755 micro /usr/bin/micro"
echo "install -m 744 AUTHORS /usr/share/doc/micro/AUTHORS"
echo "install -m 744 LICENSE /usr/share/doc/micro/LICENSE"
echo "install -m 744 LICENSE-THIRD-PARTY /usr/share/doc/micro/LICENSE-THIRD-PARTY"
echo "install -m 744 README.md /usr/share/doc/micro/README.md"
echo "install -m 744 micro.1.gz /usr/share/man/man1/micro.1.gz"
echo "install -m 744 micro.desktop /usr/share/applications/micro.desktop"
echo "install -m 744 micro.svg /usr/share/icons/micro.svg"
echo "%files"
echo "/usr/bin/micro"
echo "/usr/share/doc/micro"
echo "/usr/share/doc/micro/AUTHORS"
echo "/usr/share/doc/micro/LICENSE"
echo "/usr/share/doc/micro/LICENSE-THIRD-PARTY"
echo "/usr/share/doc/micro/README.md"
echo "/usr/share/man/man1/micro.1.gz"
echo "/usr/share/applications/micro.desktop"
echo "/usr/share/icons/micro.svg"
echo "%changelog"
echo "Version: $1-$2"
echo "Auto generated on $dategenerated by $USER@$HOSTNAME"
}
function installFiles() {
TO="$1/$2/usr/share/doc/micro/"
mkdir -p $TO
cp ../AUTHORS $TO
cp ../LICENSE $TO
cp ../LICENSE-THIRD-PARTY $TO
cp ../README.md $TO
gzip -c ../assets/packaging/micro.1 > $1/$2/usr/share/man/man1/micro.1.gz
cp ../assets/packaging/micro.deskto $1/$2/usr/share/applications/
cp ../assets/logo.svg $1/$2/usr/share/icons/micro.svg
}
version=$1
if [ "$1" == "" ]
then
version=$(go run build-version.go)
fi
echo "Building packages for Version '$version'"
echo "Running Cross-Compile"
./cross-compile.sh $version
echo "Beginning package build process"
PKGPATH="../packages/rpm"
rm -fr $PKGPATH
mkdir -p $PKGPATH/amd64/
mkdir -p $PKGPATH/i386/
buildRPMSpec "amd64" "$version" > "$PKGPATH/amd64/micro-$version-amd64.spec"
tar -xzf "../binaries/micro-$version-linux.tar.gz" "micro-$version/micro"
mv "micro-$version/micro" "$PKGPATH/amd64/usr/local/bin"
buildRPMSpec "i386" "$version" > "$PKGPATH/i386/micro-$version-i386.spec"
tar -xzf "../binaries/micro-$version-linux32.tar.gz" "micro-$version/micro"
mv "micro-$version/micro" "$PKGPATH/i386/usr/local/bin/"
rm -rf "micro-$version"
installFiles $PKGPATH "amd64"
installFiles $PKGPATH "i386"
rpmbuild -bb --buildroot $PKGPATH/amd64 $PKGPATH/amd64/micro-$version-amd64.spec
rpmbuild -bb --buildroot $PKGPATH/i386 $PKGPATH/i386/micro-$version-i386.spec