diff options
author | B Stack <bgstack15@gmail.com> | 2017-04-04 21:03:19 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2017-04-04 21:03:19 -0400 |
commit | fae60f1b93ba47723266a91c2e63a35a861475df (patch) | |
tree | d1a6e33fc178560e6491d527e69e25baefac24d2 /usr | |
parent | had scripts point to new location for rsync helper script; ver 1.0-9 (diff) | |
download | mirror-fae60f1b93ba47723266a91c2e63a35a861475df.tar.gz mirror-fae60f1b93ba47723266a91c2e63a35a861475df.tar.bz2 mirror-fae60f1b93ba47723266a91c2e63a35a861475df.zip |
udpated to 1.1-3
Diffstat (limited to 'usr')
47 files changed, 222 insertions, 276 deletions
diff --git a/usr/share/mirror/deploy.sh b/usr/share/mirror/deploy.sh index 0adb090..a218d39 100755 --- a/usr/share/mirror/deploy.sh +++ b/usr/share/mirror/deploy.sh @@ -14,7 +14,7 @@ # Improve: # * provide better package name and version parsing fiversion="2016-05-25a" -deployversion="2016-07-14a" +deployversion="2017-04-04a" usage() { less -F >&2 <<ENDUSAGE @@ -24,10 +24,10 @@ version ${deployversion} -u usage Show this usage block. -V version Show script version number. -c conffile Overrides default conffile value. Default is ${conffile}. + -n noupdate Do not execute the update script. Useful for serial deployments. Given a packagename and packageversion, this script will deploy the correct architecture type of package file to the specified locations. If debug level is 3 or less, the copy will actually be performed. See the conffile ${conffile} for examples. - -n noupdate Do not execute the update script. Useful for serial deployments. Return values: 0 Normal 1 Help or version info displayed @@ -120,7 +120,7 @@ esac . ${frameworkscript} || echo "$0: framework did not run properly. Continuing..." 1>&2 conffile=/etc/mirror/deploy.conf logfile=${scriptdir}/${scripttrim}.${today}.out -interestedparties="bgstack15@example.com" +interestedparties="bgstack15@gmail.com" noupdate=0 # can be adjusted with a flag # REACT TO ROOT STATUS @@ -212,7 +212,7 @@ do line=$( echo "${line}" | sed -e 's/^\s*//;s/\s*$//;/^[#$]/d;s/\s*[^\]#.*$//;' for thiszone in ${zones[@]}; do [[ ! "${thiszone}" = "input" ]] && { - debuglev 5 && ferror "Running zone ${thiszone}" + debuglev 5 && ferror "Running ${thiszone}" eval thislocation=\${${thiszone}location} if [[ -z "${thislocation}" ]] || [[ ! -d "${thislocation}" ]]; then continue; fi @@ -243,14 +243,14 @@ do line=$( echo "${line}" | sed -e 's/^\s*//;s/\s*$//;/^[#$]/d;s/\s*[^\]#.*$//;' # CALCULATE DESTINATION FILE destinationdir=$( { find "${thispackagedir}" -maxdepth 0 -type d; find "${thislocation}" -maxdepth 0 -type d; } 2>/dev/null | grep -viE "^$" | head -n1 ) #debuglev 5 && ferror "destinationdir=${destinationdir}" - [[ ! -d "${destinationdir}" ]] && ferror "Zone ${thiszone} file ${sourcefile} cannot be copied to the invalid directory \"${destinationdir}\". Skipped." && continue + [[ ! -d "${destinationdir}" ]] && ferror "Skipped ${thiszone} file ${sourcefile}: cannot be copied to invalid directory \"${destinationdir}\"." && continue destinationfile=$( echo "${destinationdir}/$( basename "${sourcefile}" )" | sed -e 's!\/\+!\/!g;' ) debuglev 5 && ferror "destinationfile=${destinationfile}" # PERFORM FILE COPY if [[ ! -f "${sourcefile}" ]]; then - ferror "Sourcefile ${sourcefile} not found. Skipped the copy action." + ferror "Skipped ${thiszone} source ${sourcefile}: not found." else fileaction copy "${sourcefile}" "${destinationfile}" thiszoneused=1 @@ -264,7 +264,7 @@ do line=$( echo "${line}" | sed -e 's/^\s*//;s/\s*$//;/^[#$]/d;s/\s*[^\]#.*$//;' if [[ ! -f "${sourcetarfile}" ]]; then # link was yes, but tarball does not exist, so soft error. - ferror "Sourcetarfile ${sourcetarfile} not found. Skipped the tar file symlink." + ferror "Skipped ${thiszone} symlink for ${sourcetarfile}: not found." else # CALCULATE DESTINATION TARBALL FILE destinationtarfile="$( echo "${destinationdir}/$( basename "${sourcetarfile}" )" | sed -e 's!\/\+!\/!g;' )" @@ -285,7 +285,7 @@ do line=$( echo "${line}" | sed -e 's/^\s*//;s/\s*$//;/^[#$]/d;s/\s*[^\]#.*$//;' if test "${noupdate}" = "1"; then # told to not execute any update scripts at all. - ferror "Skipping any execute scripts." + ferror "Skipping any execute scripts for ${thiszone}." else [[ -n "${thisupdatescript}" ]] && { if [[ ! -x "${thisupdatescript}" ]]; diff --git a/usr/share/mirror/docs/README.txt b/usr/share/mirror/docs/README.txt index 85afdae..2955688 100644 --- a/usr/share/mirror/docs/README.txt +++ b/usr/share/mirror/docs/README.txt @@ -1,5 +1,5 @@ -File: etc/mirror/README.txt -Package: mirror 1.0-9 +File: /usr/share/mirror/docs/README.txt +Package: mirror Author: bgstack15@gmail.com Startdate: 2016-06-08 Title: Readme file for mirror @@ -19,12 +19,7 @@ Configure these files: /etc/httpd/sites/mirror.conf /usr/share/mirror/inc/rsync -Select a storage directory. On the EXAMPLE mirror, we used an nfs mount for multiple locations. ---- BEGIN excerpt from mirror.example.com:/etc/fstab -linux-nfs2.example.com:/vol/linux_mirror /mnt/realmirror nfs defaults,uid=1539249479 0 0 -/mnt/realmirror/mirror /mnt/mirror none bind 0 0 -/mnt/mirror /var/www/html/mirror.example.com none bind 0 0 ---- END +Select a storage directory. This one is preconfigured for /srv/science/smith122/repo ## Scripts to run The files called by mirror-master are the ones that actually do the source and target selection and file operations. By default they are located in /etc/mirror/scripts/ @@ -77,7 +72,7 @@ New feature: deploy See its config file /etc/mirror/inc/deploy.conf 2016-10-28 mirror 1.0-4 -Adding elemants for safe publishing on github +Adding elements for safe publishing on github Added repos for linuxmint 2016-11-11 mirror 1.0-5 @@ -99,3 +94,14 @@ Fixed dependency to bgscripts-core 2017-02-08 mirror-1.0-9 Updated scripts to use /usr/share/mirror/inc/rsync script + +2017-03-03 mirror-1.1-1 +Adapted for smith122 repos + +2017-03-04 mirror-1.1-2 +Fixed directories' ownership to this package so they are removed when the package is removed. + +2017-04-04 mirror-1.1-3 +Fixed deploy.sh to have more consistent and useful error messages +Fixed deploy.conf to point to /srv/science for everything +Changed deploy.conf to use package directories for deployment diff --git a/usr/share/mirror/docs/debian/conffiles b/usr/share/mirror/docs/debian/conffiles deleted file mode 100644 index e69de29..0000000 --- a/usr/share/mirror/docs/debian/conffiles +++ /dev/null diff --git a/usr/share/mirror/docs/debian/control b/usr/share/mirror/docs/debian/control deleted file mode 100644 index e69de29..0000000 --- a/usr/share/mirror/docs/debian/control +++ /dev/null diff --git a/usr/share/mirror/docs/debian/postinst b/usr/share/mirror/docs/debian/postinst deleted file mode 100755 index e69de29..0000000 --- a/usr/share/mirror/docs/debian/postinst +++ /dev/null diff --git a/usr/share/mirror/docs/debian/postrm b/usr/share/mirror/docs/debian/postrm deleted file mode 100755 index e69de29..0000000 --- a/usr/share/mirror/docs/debian/postrm +++ /dev/null diff --git a/usr/share/mirror/docs/debian/preinst b/usr/share/mirror/docs/debian/preinst deleted file mode 100755 index e69de29..0000000 --- a/usr/share/mirror/docs/debian/preinst +++ /dev/null diff --git a/usr/share/mirror/docs/debian/prerm b/usr/share/mirror/docs/debian/prerm deleted file mode 100755 index e69de29..0000000 --- a/usr/share/mirror/docs/debian/prerm +++ /dev/null diff --git a/usr/share/mirror/docs/mirror.spec b/usr/share/mirror/docs/mirror.spec index b6404cb..a576b87 100644 --- a/usr/share/mirror/docs/mirror.spec +++ b/usr/share/mirror/docs/mirror.spec @@ -1,7 +1,7 @@ Summary: Mirror Name: mirror -Version: 1.0 -Release: 9 +Version: 1.1 +Release: 3 License: CC BY-SA 4.0 Group: Applications/System Source: mirror.tgz @@ -10,11 +10,11 @@ URL: bgstack15@gmail.com #Vendor: Packager: Bgstack15 <bgstack15@gmail.com> Buildarch: noarch -PreReq: bgscripts-core >= 1.1-28 +Requires(pre): bgscripts-core >= 1.1-28 Requires: httpd >= 2.2 %description -Mirror is the rpm package for the official mirror.example.com installation. +Mirror is the rpm package for the official albion320.no-ip.biz installation. %prep %setup @@ -34,57 +34,60 @@ rm -rf ${buildroot} %preun %files +%dir /etc/mirror +%dir /usr/share/mirror +%dir /usr/share/mirror/examples +%dir /usr/share/mirror/examples/examplerpm +%dir /usr/share/mirror/examples/sites +%dir /usr/share/mirror/examples/exampledeb +%dir /usr/share/mirror/inc +%dir /usr/share/mirror/docs +%dir /usr/share/mirror/scripts %config /etc/sudoers.d/50_mirror-sudo %config /etc/cron.d/mirror.cron +%config /etc/httpd/conf.d/local_mirror.conf +/etc/httpd/conf.d/local_mirror-ssl.cnf %config /etc/mirror/deploy.conf %config /etc/mirror/mirror.conf -%config /etc/httpd/conf.d/local_mirror.conf -%verify(link) /usr/local/bin/deploy +/usr/share/httpd/icons/rpm.png +/usr/share/httpd/icons/repo.png +/usr/share/mirror/deploy.sh +/usr/share/mirror/examples/examplerpm/FOOTER.html +/usr/share/mirror/examples/examplerpm/update-smith122rpm.sh +/usr/share/mirror/examples/examplerpm/HEADER.html +/usr/share/mirror/examples/examplerpm/smith122rpm.repo +/usr/share/mirror/examples/FOOTER.html +/usr/share/mirror/examples/favicon.png +%config /usr/share/mirror/examples/sites/zz_proxy.conf +/usr/share/mirror/examples/HEADER.html +/usr/share/mirror/examples/exampledeb/FOOTER.html +/usr/share/mirror/examples/exampledeb/update-smith122deb.sh +/usr/share/mirror/examples/exampledeb/smith122deb.list +/usr/share/mirror/examples/exampledeb/HEADER.html +/usr/share/mirror/examples/exampledeb/smith122deb.gpg +/usr/share/mirror/examples/favicon.ico +/usr/share/mirror/inc/get-files +%doc %attr(444, -, -) /usr/share/mirror/inc/scrub.txt +/usr/share/mirror/inc/pack +/usr/share/mirror/inc/get-files-core +/usr/share/mirror/inc/rsync +/usr/share/mirror/inc/localize_git.sh +%doc %attr(444, -, -) /usr/share/mirror/docs/files-for-versioning.txt +/usr/share/mirror/docs/mirror.spec +%doc %attr(444, -, -) /usr/share/mirror/docs/packaging.txt +%doc %attr(444, -, -) /usr/share/mirror/docs/README.txt /usr/share/mirror/mirror-master.sh -%config /usr/share/mirror/scripts/ssh +%config /usr/share/mirror/scripts/fedora-updates %config /usr/share/mirror/scripts/libreoffice -%config /usr/share/mirror/scripts/linuxmint-repos -%config /usr/share/mirror/scripts/ubuntu +%config /usr/share/mirror/scripts/ubuntu-releases %config /usr/share/mirror/scripts/putty -%config /usr/share/mirror/scripts/rsyslog +%config /usr/share/mirror/scripts/ssh +%config /usr/share/mirror/scripts/ubuntu +%config /usr/share/mirror/scripts/fedora-releases %config /usr/share/mirror/scripts/centos -%config /usr/share/mirror/scripts/fedora-epel %config /usr/share/mirror/scripts/old-scripts.tgz -%config /usr/share/mirror/scripts/ubuntu-releases +%config /usr/share/mirror/scripts/fedora-epel %config /usr/share/mirror/scripts/linuxmint-isos -%config /usr/share/mirror/scripts/fedora-releases -%config /usr/share/mirror/scripts/fedora-updates -/usr/share/mirror/docs/debian/postinst -/usr/share/mirror/docs/debian/conffiles -/usr/share/mirror/docs/debian/prerm -/usr/share/mirror/docs/debian/postrm -/usr/share/mirror/docs/debian/control -/usr/share/mirror/docs/debian/preinst -%doc %attr(444, -, -) /usr/share/mirror/docs/README.txt -/usr/share/mirror/docs/mirror.spec -%doc %attr(444, -, -) /usr/share/mirror/docs/packaging.txt -%doc %attr(444, -, -) /usr/share/mirror/docs/files-for-versioning.txt -/usr/share/mirror/deploy.sh -/usr/share/mirror/inc/pack -/usr/share/mirror/inc/localize_git.sh -%doc %attr(444, -, -) /usr/share/mirror/inc/scrub.txt -/usr/share/mirror/inc/rsync -/usr/share/mirror/examples/favicon.ico -/usr/share/mirror/examples/FOOTER.html -/usr/share/mirror/examples/HEADER.html -%config /usr/share/mirror/examples/sites/zz_proxy.conf -%config /usr/share/mirror/examples/sites/10.1.8.63.conf -%config /usr/share/mirror/examples/sites/mntscripts.conf -%config /usr/share/mirror/examples/sites/mirror.conf -/usr/share/mirror/examples/example-debian/example-debian.list -/usr/share/mirror/examples/example-debian/update-example-debian.sh -/usr/share/mirror/examples/example-debian/FOOTER.html -/usr/share/mirror/examples/example-debian/HEADER.html -/usr/share/mirror/examples/example-debian/example-debian.gpg -/usr/share/mirror/examples/example-rpm/FOOTER.html -/usr/share/mirror/examples/example-rpm/HEADER.html -/usr/share/mirror/examples/example-rpm/example-rpm.repo -/usr/share/mirror/examples/example-rpm/update-example-rpm.sh -/usr/share/mirror/examples/favicon.png -/usr/share/httpd/icons/repo.png -/usr/share/httpd/icons/rpm.png +%config /usr/share/mirror/scripts/rsyslog +%config /usr/share/mirror/scripts/linuxmint-repos +%verify(link) /usr/local/bin/deploy diff --git a/usr/share/mirror/examples/HEADER.html b/usr/share/mirror/examples/HEADER.html index 1130cfc..07bb9e4 100644 --- a/usr/share/mirror/examples/HEADER.html +++ b/usr/share/mirror/examples/HEADER.html @@ -3,46 +3,24 @@ <html> <head> - <title>Welcome to mirror.example.com</title> + <title>Welcome to Smith122 repository</title> <link rel='icon' href='favicon.ico'/> </head> <body> -<center><h1>Welcome to mirror.example.com</h1> -<!--<h6>migrated to current host 2015-12</h6>--> +<center><h1>Welcome to Smith122 repository</h1> +<!--<h6>migrated to current host 2017-03</h6>--> </center> <hr> -This is IT's <a href="http://www.opensource.org/">Open Source</a> software -mirror. We have gobs of software here to save you time downloading it from the -internet. If you need ftp access, try <a -href="ftp://mirror.example.com">ftp://mirror.example.com</a>. +If you need ftp access, try <a +href="ftp://albion320.no-ip.biz/smith122/repo">ftp://albion320.no-ip.biz/smith122/repo</a>. -<p> - -If there is a project you would like to see mirrored, let us know at the e-mail -address at the bottom and we'll see what we can do. We can't guarantee your -favorite project will be mirrored, but if you have a reasonable request, we -will most likely be able to comply. - -<p> - -<strong>WARNING!</strong> There is no guarantee that this box will always be -up or that the software contained on it will be up-to-date, bug-free, safe, -uncorrupted or complete. Use this box and the software contained on it -<em>at your own risk</em>. -Due to the nature of maintaining this box, IT cannot take any responsibility -for problems or damage incurred by the software from this box. Please -<em>DO NOT </em> contact the Helpdesk with problems or questions concerning -this box. If you have questions, comments, or problem reports, contact <a href="mailto:mirror@example.com">mirror Administrator</a>. However, as this is an "unofficial" -IT project, any response may be highly delayed. -<p> -That being said, have fun! -E-Mail the administrator at: <a href="mailto:mirror@example.com">mirror@example.com</a>. +E-Mail the administrator at: <a href="mailto:bgstack15@gmail.com">bgstack15@gmail.com</a>. <hr> <table style="width:50%"> <tr><td> -Force http: <a href="http://mirror.example.com">http://mirror.example.com</a></td><td> -Force https: <a href="https://mirror.example.com">https://mirror.example.com</a></td></tr></table> +Force http: <a href="http://albion320.no-ip.biz/smith122/repo/">http://albion320.no-ip.biz/smith122/repo/</a></td><td> +Force https: <a href="https://albion320.no-ip.biz/smith122/repo/">https://albion320.no-ip.biz/smith122/repo/</a></td></tr></table> </body> </html> diff --git a/usr/share/mirror/examples/example-debian/HEADER.html b/usr/share/mirror/examples/example-debian/HEADER.html deleted file mode 100644 index 6ffade1..0000000 --- a/usr/share/mirror/examples/example-debian/HEADER.html +++ /dev/null @@ -1,13 +0,0 @@ -<html> -<title>mirror.example.com/ubuntu/example-debian repository</title> -<body> -<h1>mirror.example.com/bgscripts</h1> -<hr> -<p>You can install the example-debian repo in the /etc/apt/sources.list.d/ directory with these command: -<pre> -sudo wget --quiet http://mirror.example.com/ubuntu/example-debian/example-debian.gpg -O /root/example-debian.gpg -sudo apt-key add /root/example-debian.gpg -sudo wget --quiet http://mirror.example.com/ubuntu/example-debian/example-debian.list -O /etc/apt/sources.list.d/example-debian.list -</pre> -</body> -</html> diff --git a/usr/share/mirror/examples/example-debian/example-debian.list b/usr/share/mirror/examples/example-debian/example-debian.list deleted file mode 100644 index ad21fbb..0000000 --- a/usr/share/mirror/examples/example-debian/example-debian.list +++ /dev/null @@ -1 +0,0 @@ -deb http://mirror.example.com/ubuntu/example-debian/ / diff --git a/usr/share/mirror/examples/example-rpm/FOOTER.html b/usr/share/mirror/examples/example-rpm/FOOTER.html deleted file mode 100644 index 57b6775..0000000 --- a/usr/share/mirror/examples/example-rpm/FOOTER.html +++ /dev/null @@ -1,8 +0,0 @@ -<html> -<head> -<title>mirror.example.com/example-rpm repository</title> -</head> -<body> -<p>Most contents are licensed under CC BY-SA 4.0.</p> -</body> -</html> diff --git a/usr/share/mirror/examples/example-rpm/HEADER.html b/usr/share/mirror/examples/example-rpm/HEADER.html deleted file mode 100644 index 105f0d8..0000000 --- a/usr/share/mirror/examples/example-rpm/HEADER.html +++ /dev/null @@ -1,9 +0,0 @@ -<html> -<body> -<h1>mirror.example.com/example-rpm</h1> -<hr> -<p>You can install the example-rpm.repo in the /etc/yum.repos.d/ directory with this command: -<pre>wget http://mirror.example.com/example-rpm/example-rpm.repo -O /etc/yum.repos.d/example-rpm.repo -yum -y install bgscripts keepalive</pre> -</body> -</html> diff --git a/usr/share/mirror/examples/example-rpm/example-rpm.repo b/usr/share/mirror/examples/example-rpm/example-rpm.repo deleted file mode 100644 index 12bca22..0000000 --- a/usr/share/mirror/examples/example-rpm/example-rpm.repo +++ /dev/null @@ -1,8 +0,0 @@ -# example-rpm.repo -# Install with: -# wget http://mirror.example.com/bgscripts/example-rpm.repo -O /etc/yum.repos.d/example-rpm.repo -[example-rpm] -name=example-rpm -baseurl=http://mirror.example.com/bgscripts/ -gpgcheck=0 -#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 diff --git a/usr/share/mirror/examples/example-debian/FOOTER.html b/usr/share/mirror/examples/exampledeb/FOOTER.html index 7879e1c..7879e1c 100644 --- a/usr/share/mirror/examples/example-debian/FOOTER.html +++ b/usr/share/mirror/examples/exampledeb/FOOTER.html diff --git a/usr/share/mirror/examples/exampledeb/HEADER.html b/usr/share/mirror/examples/exampledeb/HEADER.html new file mode 100644 index 0000000..50d8bfa --- /dev/null +++ b/usr/share/mirror/examples/exampledeb/HEADER.html @@ -0,0 +1,13 @@ +<html> +<title>Smith122 deb repository</title> +<body> +<h1>Smith122 deb repository</h1> +<hr> +<p>You can install the smith122deb repo in the /etc/apt/sources.list.d/ directory with these commands: +<pre> +sudo wget --quiet http://albion320.no-ip.biz/smith122/repo/deb/smith122deb.gpg -O /root/smith122deb.gpg +sudo apt-key add /root/smith122deb.gpg +sudo wget --quiet http://albion320.no-ip.biz/smith122/repo/deb/smith122deb.list -O /etc/apt-sources.list.d/smith122deb.list +</pre> +</body> +</html> diff --git a/usr/share/mirror/examples/example-debian/example-debian.gpg b/usr/share/mirror/examples/exampledeb/smith122deb.gpg index d64a765..d64a765 100644 --- a/usr/share/mirror/examples/example-debian/example-debian.gpg +++ b/usr/share/mirror/examples/exampledeb/smith122deb.gpg diff --git a/usr/share/mirror/examples/exampledeb/smith122deb.list b/usr/share/mirror/examples/exampledeb/smith122deb.list new file mode 100644 index 0000000..feb67e2 --- /dev/null +++ b/usr/share/mirror/examples/exampledeb/smith122deb.list @@ -0,0 +1 @@ +deb http://albion320.no-ip.biz/smith122/repo/deb/ / diff --git a/usr/share/mirror/examples/example-debian/update-example-debian.sh b/usr/share/mirror/examples/exampledeb/update-smith122deb.sh index 0a6e7a0..a33d571 100755 --- a/usr/share/mirror/examples/example-debian/update-example-debian.sh +++ b/usr/share/mirror/examples/exampledeb/update-smith122deb.sh @@ -1,9 +1,10 @@ #!/bin/sh # working directory -repodir=/mnt/mirror/ubuntu/example-debian/ +repodir=/srv/science/smith122/repo/deb/ cd ${repodir} chmod 0644 *deb 1>/dev/null 2>&1 +restorecon -RF "${repodir}" # create the package index dpkg-scanpackages -m . > Packages diff --git a/usr/share/mirror/examples/examplerpm/FOOTER.html b/usr/share/mirror/examples/examplerpm/FOOTER.html new file mode 100644 index 0000000..0aeb772 --- /dev/null +++ b/usr/share/mirror/examples/examplerpm/FOOTER.html @@ -0,0 +1,8 @@ +<html> +<head> +<title>Smith122 rpm repository</title> +</head> +<body> +<p>All contents are licensed under CC BY-SA 4.0.</p> +</body> +</html> diff --git a/usr/share/mirror/examples/examplerpm/HEADER.html b/usr/share/mirror/examples/examplerpm/HEADER.html new file mode 100644 index 0000000..274e2ca --- /dev/null +++ b/usr/share/mirror/examples/examplerpm/HEADER.html @@ -0,0 +1,12 @@ +<html> +<head> +<title>Smith122 rpm repository</title> +</head> +<body> +<h1>Smith122 rpm repository</h1> +<hr> +<p>You can install the smith122rpm.repo in the /etc/yum.repos.d/ directory with this command: +<pre>wget http://albion320.no-ip.biz/smith122/repo/rpm/smith122rpm.repo -O /etc/yum.repos.d/smith122rpm.repo +</pre> +</body> +</html> diff --git a/usr/share/mirror/examples/examplerpm/smith122rpm.repo b/usr/share/mirror/examples/examplerpm/smith122rpm.repo new file mode 100644 index 0000000..48bcc9b --- /dev/null +++ b/usr/share/mirror/examples/examplerpm/smith122rpm.repo @@ -0,0 +1,7 @@ +# smith122rpm.repo +# Install with: +# wget http://albion320.no-ip.biz/smith122/repo/rpm/smith122rpm.repo -O /etc/yum.repos.d/smith122rpm.repo +[smith122rpm] +name=smith122rpm +baseurl=http://albion320.no-ip.biz/smith122/repo/rpm/ +gpgcheck=0 diff --git a/usr/share/mirror/examples/example-rpm/update-example-rpm.sh b/usr/share/mirror/examples/examplerpm/update-smith122rpm.sh index b3003af..a6c38a9 100755 --- a/usr/share/mirror/examples/example-rpm/update-example-rpm.sh +++ b/usr/share/mirror/examples/examplerpm/update-smith122rpm.sh @@ -1,9 +1,10 @@ #!/bin/sh # working directory -repodir=/mnt/mirror/bgscripts/ +repodir=/srv/science/smith122/repo/rpm/ cd ${repodir} chmod 0644 *rpm 1>/dev/null 2>&1 +restorecon -RF "${repodir}" # create the package index createrepo . diff --git a/usr/share/mirror/examples/sites/10.1.8.63.conf b/usr/share/mirror/examples/sites/10.1.8.63.conf deleted file mode 100644 index 7afda1b..0000000 --- a/usr/share/mirror/examples/sites/10.1.8.63.conf +++ /dev/null @@ -1,5 +0,0 @@ -# File: /etc/httpd/sites/{ipaddress}.conf -# Package: mirror -# Purpose: A template for the mirror apache listeners. This is probably redundant, but in case it's needed, fix the IP address here and in the filename. -Listen 10.1.8.63:80 -Listen 10.1.8.63:443 diff --git a/usr/share/mirror/examples/sites/mirror.conf b/usr/share/mirror/examples/sites/mirror.conf deleted file mode 100644 index 5f2e761..0000000 --- a/usr/share/mirror/examples/sites/mirror.conf +++ /dev/null @@ -1,65 +0,0 @@ -# File: /etc/httpd/sites/mirror.conf -# Package: mirror -# Title: Apache mirror config -# Purpose: To provide a standard mirror http and https site -# Reference: -# Instructions: -# you can make a simple IP listener conf with the following -# thisip=$( ifconfig 2>/dev/null | awk '/Bcast|broadcast/{print $2}' | tr -cd '[^0-9\.\n]' | head -n1) -# printf "Listen %s\nListen %s" "${thisip}:80" "${thisip}:443" > /etc/httpd/sites/${thisip}.conf -# Be sure to fix the IP addresses here for the virtual hosts. -# Also ensure /etc/hosts has the right hostnames configured for the ssl vhost below -# Document: Below this line - -<VirtualHost 10.1.8.63:80> - - ServerName mirror.example.com:80 - ServerAlias mirror brass mirror-brass mirrorbrass brassmirror *.mirror.example.com brass.example.com - # this server also provides bgscripts.repo at http://mirror.example.com/bgscripts which is /var/www/html/mirror.example.com/bgscripts - - DocumentRoot "/var/www/html/mirror.example.com" - - Alias /mirror /mnt/mirror - - # Index options - Options +Indexes - IndexOptions IgnoreCase FancyIndexing FoldersFirst NameWidth=* DescriptionWidth=* SuppressHTMLPreamble - IndexIgnore FOOTER.html repodata tivoli *.so bgscripts - ReadmeName FOOTER.html - - # Useful additions for the mirror - AddIcon /icons/rpm.png .rpm - AddIcon /icons/repo.png .repo - AddType application/octet-stream .iso - - <Directory "/var/www/html/mirror.example.com"> - AllowOverride None - Order allow,deny - Allow from all - Options Indexes FollowSymLinks - </Directory> - - # Allows "centos.mirror.example.com" redirection to "mirror.example.com/centos" behavior - RewriteEngine On - RewriteCond %{HTTP_HOST} ^([^.]*)\.mirror\.example\.com$ - RewriteRule /(.*) http://mirror.example.com/%1/$1 [R,L] - -</VirtualHost> - -<VirtualHost 10.1.8.63:443> - SSLEngine on - SSLProtocol all -SSLv2 -SSLv3 - SSLHonorCipherOrder on - SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS" - SSLCertificateFile /etc/pki/tls/certs/wildcard.crt - SSLCertificateKeyFile /etc/pki/tls/private/wildcard.key - SSLCACertificateFile /etc/pki/tls/certs/rapidssl.crt - - LogLevel warn - # Reverse proxy all ssl traffic to the nonencrypted site. This is a template for any and all sites. - # Observe that this depends on /etc/hosts or DNS to look up the variable SERVER_NAME - SSLProxyEngine On - RewriteEngine On - RewriteRule ^/(.*)$ http://%{SERVER_NAME}/$1 [P,L] - -</VirtualHost> diff --git a/usr/share/mirror/examples/sites/mntscripts.conf b/usr/share/mirror/examples/sites/mntscripts.conf deleted file mode 100644 index 31cdc6b..0000000 --- a/usr/share/mirror/examples/sites/mntscripts.conf +++ /dev/null @@ -1,24 +0,0 @@ -<VirtualHost 10.1.8.63:80> - - ServerName mntscripts.example.com:80 - ServerAlias mntscripts scripts scripts.example.com - - DocumentRoot "/var/www/html/mntscripts.example.com" - - AddType application/octet-stream .iso - - #Alias /mirror /mnt/mirror - - Options +Indexes - IndexOptions FancyIndexing NameWidth=* DescriptionWidth=* - IndexIgnore FOOTER.html repodata - ReadmeName FOOTER.html - - <Directory "/var/www/html/mntscripts.example.com"> - AllowOverride None - Order allow,deny - Allow from all - Options Indexes FollowSymLinks - </Directory> - -</VirtualHost> diff --git a/usr/share/mirror/examples/sites/zz_proxy.conf b/usr/share/mirror/examples/sites/zz_proxy.conf index c6221de..fcd666a 100644 --- a/usr/share/mirror/examples/sites/zz_proxy.conf +++ b/usr/share/mirror/examples/sites/zz_proxy.conf @@ -1,28 +1,15 @@ -# File: /etc/httpd/sites/zz_proxy.conf +# File: /usr/share/mirror/examples/sites/zz_proxy.conf <Proxy *> Order deny,allow Deny from all # Allow each host or range as desired. - - Allow from 203.0.193.232/255.255.255.255 - Allow from 10.1.9.194/32 - # Whole Linux dev subnet - Allow from 10.1.9.0/24 - # Whole IT-192 network in vmware so I do not have to keep doing this - Allow from 203.0.192.0/23 - # onyx for webtatic - Allow from 10.1.9.121/32 - # company-owned wireless devices subnets - Allow from 10.48.0.0/16 - # personally-owned wireless devices - Allow from 10.21.0.0/16 - + Allow from 192.168.1.0/24 </Proxy> -Listen 10.1.8.63:8090 -<VirtualHost 10.1.8.63:8080> +Listen 192.168.1.11:8090 +<VirtualHost 192.168.1.11:8090> - ServerName junk.example.com:8080 + ServerName junk.albion320.no-ip.biz:8090 ServerAlias * DocumentRoot /var/www/html/notfound diff --git a/usr/share/mirror/inc/get-files b/usr/share/mirror/inc/get-files new file mode 100755 index 0000000..8ad528b --- /dev/null +++ b/usr/share/mirror/inc/get-files @@ -0,0 +1,36 @@ +#!/bin/sh +# File: get-files +case "${1}" in + rpm) + +### for rpm +find * -type d \ + \( \ + -regex 'usr\/share\/mirror.*' \ + -o -regex 'etc\/mirror.*' \ + \) \ + | sed -e 's/^/%dir \//;' +find * -mindepth 1 ! -name "${package}.spec.$$.swp" \ + ! -type d \ + ! -regex '.*.swp' \ + ! -regex '.*?DEBIAN.*?' \ + | sed -e ' +s/^/\//; +s/\(.*\.txt\)/%doc %attr(444, -, -) \1/; +s/\(.*\.\(conf\|cron\)\|.*sudoers\.d\|\/usr\/share\/mirror\/scripts\/.\+\)/%config \1/; +s/\(.*bin.*\)/%verify(link) \1/; +s/\(.*\)\.py$/\1\.py\n\1\.pyc\n\1\.pyo/; +' + ;; + deb) + +### for deb +# will be redirected to md5sum +echo "Error: Unh. Feature not yet implemented. Aborted." && exit 1 + + ;; + *) + echo "FATAL ERROR: check ./pack or get-files. Please use [ rpm | deb ] option. Aborted." 1>&2 + exit 1 + ;; +esac diff --git a/usr/share/mirror/inc/get-files-core b/usr/share/mirror/inc/get-files-core new file mode 100755 index 0000000..a3feb42 --- /dev/null +++ b/usr/share/mirror/inc/get-files-core @@ -0,0 +1,43 @@ +#!/bin/sh +# File: get-files-core +case "${1}" in + rpm) + +### for rpm +find * -type d \ + -regex 'usr\/share\/bgscripts.*' \ + ! -regex '.*icons.*' \ + | sed -e 's/^/%dir \//;' +find * -mindepth 1 ! -name "${package}.spec.$$.swp" \ + ! -type d \ + ! -regex '.*.swp' \ + ! -regex '.*?DEBIAN.*?' \ + ! -regex '.*\/rdp.*' ! -regex '.*rdp\..*' \ + ! -regex '.*get-files$' \ + ! -regex '.*icons.*' \ + | sed -e ' +s/^/\// +s/\(.*\.txt\)/%doc %attr(444, -, -) \1/ +s/\(.*bin.*\)/%verify(link) \1/ +s/\(.*\)\.py$/\1\.py\n\1\.pyc\n\1\.pyo/ +s/\(.*\.conf\)/%config %attr(666, -, -) \1/ +' + + ;; + deb) + +### for deb +find . -mindepth 1 ! -name "${package}.spec.$$.swp" \ + ! -type d \ + ! -regex '.*?DEBIAN.*' ! -regex '.*?.swp' ! -regex '.*\.git.*' \ + ! -regex '.*\/rdp.*' ! -regex '.*rdp\..*' \ + ! -regex '.*get-files$' \ + ! -regex '.*icons.*' \ + -printf '%P ' + + ;; + *) + echo "FATAL ERROR: check ./pack or get-files-core. Please use [ rpm | deb ] option. Aborted." 1>&2 + exit 1 + ;; +esac diff --git a/usr/share/mirror/inc/localize_git.sh b/usr/share/mirror/inc/localize_git.sh index abf997a..a522f50 100755 --- a/usr/share/mirror/inc/localize_git.sh +++ b/usr/share/mirror/inc/localize_git.sh @@ -1,2 +1,2 @@ #!/bin/sh -\cp -pRf /home/work/mirror.clean/.git /home/bgstack15/rpmbuild/SOURCES/mirror-1.0-9/ +\cp -pRf /home/work/mirror.clean/.git /home/bgstack15/rpmbuild/SOURCES/mirror-1.1-3/ diff --git a/usr/share/mirror/inc/pack b/usr/share/mirror/inc/pack index fb17d85..733630e 100755 --- a/usr/share/mirror/inc/pack +++ b/usr/share/mirror/inc/pack @@ -13,13 +13,12 @@ type=""; case "${thisflavor}" in redhat|rhel|centos|fedora|korora) type=rpm;; debian|ubuntu) type=dpkg;; - *) type=targz;; -esac + *) type=targz;; esac echo " $@ " | grep -qiE -- "help|usage|\s-h\s|\s-\?" 1>/dev/null 2>&1 && { # display help and exit less -F <<EOF -pack utility version 2017-02-07a-mirror +pack utility version 2017-04-04a-mirror usage: pack [ rpm | deb | tar | scrub ] [ --debug | -d {0-10} ] Provides a single command for building a package. This script is customized to each package. optional arguments: @@ -54,16 +53,15 @@ rpmbuilddir=~/rpmbuild/ packagespecfile="${package}-${version}/usr/share/${package}/docs/${package}.spec" sed -i -n '1,/^\%files$/p;' "${rpmbuilddir}/SOURCES/${packagespecfile}" cd "${rpmbuilddir}/SOURCES/${package}-${version}" -find * ! -type d ! -regex '.*?.swp' ! -regex '.*?DEBIAN.*?' | sed -e 's/^/\//;' -e 's/\(.*\.txt\)/%doc %attr(444, -, -) \1/;' -e 's/\(.*\.\(conf\|cron\)\|.*sudoers\.d\|\/usr\/share\/mirror\/scripts\/.\+\)/%config \1/;' -e 's/\(.*bin.*\)/%verify(link) \1/;' -e 's/\(.*\)\.py$/\1\.py\n\1\.pyc\n\1\.pyo/;' >> "${rpmbuilddir}/SOURCES/${packagespecfile}" -rm -rf "${rpmbuilddir}/SOURCES/${package}-${shortversion}" -cp -prf "${rpmbuilddir}/SOURCES/${package}-${version}" "${rpmbuilddir}/SOURCES/${package}-${shortversion}" +"${rpmbuilddir}/SOURCES/${package}-${version}/usr/share/${package}/inc/get-files" rpm >> "${rpmbuilddir}/SOURCES/${packagespecfile}" +rm -rf "${rpmbuilddir}/SOURCES/${package}-${shortversion}"; cp -prf "${rpmbuilddir}/SOURCES/${package}-${version}" "${rpmbuilddir}/SOURCES/${package}-${shortversion}" rm -rf "${rpmbuilddir}/SOURCES/${package}-${shortversion}/DEBIAN" cd "${rpmbuilddir}/SOURCES" -rm -rf "${package}.tgz"; tar -zc --exclude='.git' -f "${package}.tgz" "${package}-${shortversion}" && rm -rf "${rpmbuilddir}/SOURCES/${package}-${shortversion}/" +rm -rf "${package}.tgz"; tar -zc --exclude='.git' --exclude='README.md' -f "${package}.tgz" "${package}-${shortversion}" cp -p "${rpmbuilddir}/SOURCES/${packagespecfile}" "${rpmbuilddir}/SPECS" -cd "${rpmbuilddir}/RPMS/noarch" +mkdir -p "${rpmbuilddir}/RPMS/noarch"; cd "${rpmbuilddir}/RPMS/noarch" 2>/dev/null rpmbuild -bb "${rpmbuilddir}/SPECS/${package}.spec" -rm -rf "${rpmbuilddir}/SOURCES/${package}.tgz" +rm -rf "${rpmbuilddir}/SOURCES/${package}-${shortversion}/" "${rpmbuilddir}/SOURCES/${package}.tgz" ;; dpkg) diff --git a/usr/share/mirror/inc/rsync b/usr/share/mirror/inc/rsync index 710ecb7..47fe881 100644 --- a/usr/share/mirror/inc/rsync +++ b/usr/share/mirror/inc/rsync @@ -1,7 +1,7 @@ #!/bin/sh # # rsync: Specific functions and options for rsync use -# Original source may be from David Lowry but is uncertain. +# Original source is uknown. #RSYNCOPTIONS="--delete-during -l -p -r -t -v" RSYNCOPTIONS="-rlptv --del" diff --git a/usr/share/mirror/inc/scrub.txt b/usr/share/mirror/inc/scrub.txt index 72d4e35..45fb831 100644 --- a/usr/share/mirror/inc/scrub.txt +++ b/usr/share/mirror/inc/scrub.txt @@ -1,5 +1,5 @@ # for scrubpy version 2016-11-16a or newer -source /home/bgstack15/rpmbuild/SOURCES/mirror-1.0-9 +source /home/bgstack15/rpmbuild/SOURCES/mirror-1.1-3 target /home/work/mirror.clean ignore "tgz png gif jpg pyc pyo git swp ico" # rest of the lines are "OLD WORD" "NEW WORD" @@ -12,18 +12,3 @@ bname bname STACK15 STACK15 Stack15 Stack15 stack15 stack15 -Alice Alice -alice alice -User1 User1 -user1 user1 -Luser1 Auser1 -luser1 auser1 -EXAMPLE EXAMPLE -example example -".COM" ".COM" -".com" ".com" -"203.0." "203.0." -SMITH123 SMITH123 -Smith123 Smith123 -smith123 smith123 -one one diff --git a/usr/share/mirror/mirror-master.sh b/usr/share/mirror/mirror-master.sh index 8c7f33e..4e5334b 100755 --- a/usr/share/mirror/mirror-master.sh +++ b/usr/share/mirror/mirror-master.sh @@ -13,7 +13,7 @@ # 2017-02-06 rearranged mirror package to FHS 3.0 # Usage: Call in cron every day # Reference: ftemplate.sh 2015-11-23a; framework.sh 2015-11-23a -# mirror.luser1 (2014-11-11) +# mirror.lcroce (2014-11-11) # Improve: fiversion="2015-11-23a" mirrormasterversion="2017-02-06a" diff --git a/usr/share/mirror/scripts/centos b/usr/share/mirror/scripts/centos index 0254b70..0254b70 100755..100644 --- a/usr/share/mirror/scripts/centos +++ b/usr/share/mirror/scripts/centos diff --git a/usr/share/mirror/scripts/fedora-epel b/usr/share/mirror/scripts/fedora-epel index 0c65042..0c65042 100755..100644 --- a/usr/share/mirror/scripts/fedora-epel +++ b/usr/share/mirror/scripts/fedora-epel diff --git a/usr/share/mirror/scripts/fedora-releases b/usr/share/mirror/scripts/fedora-releases index 3b2b4ab..3b2b4ab 100755..100644 --- a/usr/share/mirror/scripts/fedora-releases +++ b/usr/share/mirror/scripts/fedora-releases diff --git a/usr/share/mirror/scripts/fedora-updates b/usr/share/mirror/scripts/fedora-updates index e78b71f..e78b71f 100755..100644 --- a/usr/share/mirror/scripts/fedora-updates +++ b/usr/share/mirror/scripts/fedora-updates diff --git a/usr/share/mirror/scripts/libreoffice b/usr/share/mirror/scripts/libreoffice index cf88808..cf88808 100755..100644 --- a/usr/share/mirror/scripts/libreoffice +++ b/usr/share/mirror/scripts/libreoffice diff --git a/usr/share/mirror/scripts/linuxmint-isos b/usr/share/mirror/scripts/linuxmint-isos index 33a1cc3..33a1cc3 100755..100644 --- a/usr/share/mirror/scripts/linuxmint-isos +++ b/usr/share/mirror/scripts/linuxmint-isos diff --git a/usr/share/mirror/scripts/linuxmint-repos b/usr/share/mirror/scripts/linuxmint-repos index 1e808b5..1e808b5 100755..100644 --- a/usr/share/mirror/scripts/linuxmint-repos +++ b/usr/share/mirror/scripts/linuxmint-repos diff --git a/usr/share/mirror/scripts/putty b/usr/share/mirror/scripts/putty index b58fd8b..b58fd8b 100755..100644 --- a/usr/share/mirror/scripts/putty +++ b/usr/share/mirror/scripts/putty diff --git a/usr/share/mirror/scripts/rsyslog b/usr/share/mirror/scripts/rsyslog index da9c287..da9c287 100755..100644 --- a/usr/share/mirror/scripts/rsyslog +++ b/usr/share/mirror/scripts/rsyslog diff --git a/usr/share/mirror/scripts/ssh b/usr/share/mirror/scripts/ssh index 2e530bb..2e530bb 100755..100644 --- a/usr/share/mirror/scripts/ssh +++ b/usr/share/mirror/scripts/ssh diff --git a/usr/share/mirror/scripts/ubuntu b/usr/share/mirror/scripts/ubuntu index e308bab..e308bab 100755..100644 --- a/usr/share/mirror/scripts/ubuntu +++ b/usr/share/mirror/scripts/ubuntu diff --git a/usr/share/mirror/scripts/ubuntu-releases b/usr/share/mirror/scripts/ubuntu-releases index c8ea52b..c8ea52b 100755..100644 --- a/usr/share/mirror/scripts/ubuntu-releases +++ b/usr/share/mirror/scripts/ubuntu-releases |