Skip to content

Commit

Permalink
Fedora 27 EZ template initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mechleg committed Nov 16, 2017
1 parent 681311b commit 82ce9e5
Show file tree
Hide file tree
Showing 33 changed files with 1,407 additions and 0 deletions.
1 change: 1 addition & 0 deletions cyrus-imap_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cyrus-imapd
7 changes: 7 additions & 0 deletions cyrus-imap_post-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Turn ports on
/usr/bin/firewall-offline-cmd --port 110:tcp --port 143:tcp --port 993:tcp --port 995:tcp --port 4190:tcp > /dev/null 2>&1
/bin/systemctl try-restart firewalld > /dev/null 2>&1

exit 0
60 changes: 60 additions & 0 deletions devel_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
autoconf
patchutils
rpm-build
gcc
gcc-c++
gcc-objc
gdb
openjade
texlive
tex-preview
libtool
automake
cpp
passivetex
texinfo
dejagnu
flex
dos2unix
doxygen
bison
byacc
docbook-style-xsl
xmlto
strace
docbook-dtds
texlive-xmltex
texlive-xmltex-bin
apr-devel
apr-util-devel
cups-devel
libcurl-devel
rpm-devel
python-devel
glib2-devel
gnutls-devel
bzip2-devel
httpd-devel
libattr-devel
libacl-devel
libgcrypt-devel
libgpg-error-devel
audit-libs-devel
unixODBC-devel
tcl-devel
pam-devel
readline-devel
libtiff-devel
libxml2-devel
libxslt-devel
ncurses-devel
net-snmp-devel
libpng-devel
freetype-devel
fontconfig-devel
redhat-rpm-config
nss-devel
nss-softokn-devel
nss-softokn-freebl-devel
gettext-devel
libcap-devel
150 changes: 150 additions & 0 deletions fedora-27-x86_64-ez.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# template name attributes
%define templatename fedora
%define templatever 27
%define templatearch x86_64

# Human-readable attributes
%define fullname Fedora %templatever
%define fulltemplatearch (for AMD64/Intel EM64T)

# template dirs
%define templatedir /vz/template/%templatename/%templatever/%templatearch/config
%define ostemplatedir %templatedir/os/default

# vzpkgenv related
%define pkgman 410x64
%define package_manager rpm%pkgman
%define package_manager_pkg vzpkgenv%pkgman >= 7.0.0

# Files lists
%define files_lst() \
find %1 -type d -printf '%%%dir %%%attr(%m,root,root) %p\\n' | sed "s,%buildroot,,g" >> %2\
find %1 -type f -printf '%%%config %%%attr(%m,root,root) %p\\n' | sed "s,%buildroot,,g" >> %2\
%nil

# Sources list
%define sources_lst() \
%((cd %_sourcedir;\
s=1;\
for tmpl in %1; do\
sources=$tmpl"_*";\
for file in $sources; do\
echo Source$s: $file;\
s=$((s+1))\
done;\
done))\
%nil

# Obsoletes list
%define obsoletes_lst() \
%((for tmpl in %1; do\
[ $tmpl = os ] && continue;\
echo "Obsoletes: $tmpl-%templatename-%templatever-%templatearch-ez < 7.0.0";\
echo "Provides: $tmpl-%templatename-%templatever-%templatearch-ez = %version-%release";\
done))\
%nil

# Templates list - packages file should be always present in any template!
%define templates_list() %((cd %_sourcedir; for f in *_packages; do echo -n "${f%_*} "; done))

Summary: %fullname %fulltemplatearch Template set
Name: %templatename-%templatever-%templatearch-ez
Group: Virtuozzo/Templates
License: GPL
Version: 7.0.0
Release: 1%{?dist}
BuildRoot: %_tmppath/%name-root
BuildArch: noarch
Requires: %package_manager_pkg

# template source files
%sources_lst %templates_list

# obsoletes
%obsoletes_lst %templates_list

%description
%fullname %fulltemplatearch packaged as a Virtuozzo Template set.

%install
installfile() {
local sourcename=%_sourcedir/${1}_$4
local mode=$2
local dir=$3
local name=$4

[ ! -f $sourcename ] && return

install -m $mode $sourcename $dir/$name
}

rm -f files.lst
for tmpl in %templates_list; do
[ $tmpl = "os" ] && dir=%buildroot/%ostemplatedir || \
dir=%buildroot/%templatedir/app/$tmpl/default

mkdir -p $dir

if [ $tmpl = "os" ]; then
# Os template only files

# Text
echo "%fullname %fulltemplatearch Virtuozzo Template" > $dir/description
echo "%fullname %fulltemplatearch Virtuozzo Template" > $dir/summary

# Package manager
echo "%package_manager" > $dir/package_manager

# Disable upgrade
touch $dir/upgradable_versions

# Pkgman environment
installfile $tmpl 0644 $dir environment

# vzctl-related
installfile $tmpl 0644 $dir distribution

# Kernel virtualization
installfile $tmpl 0644 $dir osrelease

# Os template cache scripts
installfile $tmpl 0755 $dir pre-cache
installfile $tmpl 0755 $dir post-cache
installfile $tmpl 0755 $dir mid-pre-install
installfile $tmpl 0755 $dir mid-post-install
installfile $tmpl 0755 $dir pre-upgrade
installfile $tmpl 0755 $dir post-upgrade
else
# App templates only files

# Text
echo "$tmpl for %fullname %fulltemplatearch Virtuozzo Template" > $dir/description
echo "$tmpl for %fullname %fulltemplatearch Virtuozzo Template" > $dir/summary
fi

# Common things

# Installation sources
installfile $tmpl 0644 $dir mirrorlist
installfile $tmpl 0644 $dir repositories

# Packages
installfile $tmpl 0644 $dir packages

# Scripts
installfile $tmpl 0755 $dir pre-install
installfile $tmpl 0755 $dir pre-install-hn
installfile $tmpl 0755 $dir post-install
installfile $tmpl 0755 $dir post-install-hn

# Versioning
echo "%release" > $dir/release
echo "%version" > $dir/version
%files_lst $dir files.lst
done

%files -f files.lst

%changelog
* Wed Nov 15 2017 mechleg <mechleg@mechleg.com> 7.0.0-1
- Initial release
17 changes: 17 additions & 0 deletions jre_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
java-1.8.0-openjdk
apache-commons-collections
apache-commons-logging
apache-commons-daemon
apache-commons-pool
apache-commons-dbcp
xml-commons-apis
xml-commons-resolver
xalan-j2
xerces-j2
geronimo-jms
javamail
log4j
log4j12
geronimo-jta
avalon-framework
avalon-logkit
1 change: 1 addition & 0 deletions jsdk_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java-1.8.0-openjdk-devel
1 change: 1 addition & 0 deletions mailman_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mailman
2 changes: 2 additions & 0 deletions mod_perl_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod_perl
mod_perl-devel
1 change: 1 addition & 0 deletions mod_ssl_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod_ssl
7 changes: 7 additions & 0 deletions mod_ssl_post-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# Turn ports on
/usr/bin/firewall-offline-cmd --port 443:tcp > /dev/null 2>&1
/bin/systemctl try-restart firewalld > /dev/null 2>&1

exit 0
4 changes: 4 additions & 0 deletions mysql_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mariadb-server
mariadb-devel
mariadb-bench
perl-DBD-MySQL
Loading

0 comments on commit 82ce9e5

Please sign in to comment.