From 78ff4843bd15d5d4cebbf5289e7ca91bcdca8001 Mon Sep 17 00:00:00 2001 From: B Stack Date: Sat, 14 Oct 2017 15:38:29 -0400 Subject: arrange directory structure to current standards --- usr/share/ddtools/build/ddtools.spec | 62 ++++++++++++ usr/share/ddtools/build/files-for-versioning.txt | 3 + usr/share/ddtools/build/get-files | 40 ++++++++ usr/share/ddtools/build/pack | 116 +++++++++++++++++++++++ usr/share/ddtools/doc | 1 + usr/share/ddtools/docs/README.txt | 48 ---------- usr/share/ddtools/docs/ddtools.spec | 59 ------------ usr/share/ddtools/docs/files-for-versioning.txt | 3 - usr/share/ddtools/inc/get-files | 40 -------- usr/share/ddtools/inc/pack | 116 ----------------------- usr/share/doc/ddtools/README.txt | 51 ++++++++++ usr/share/doc/ddtools/version.txt | 1 + 12 files changed, 274 insertions(+), 266 deletions(-) create mode 100644 usr/share/ddtools/build/ddtools.spec create mode 100644 usr/share/ddtools/build/files-for-versioning.txt create mode 100755 usr/share/ddtools/build/get-files create mode 100755 usr/share/ddtools/build/pack create mode 120000 usr/share/ddtools/doc delete mode 100644 usr/share/ddtools/docs/README.txt delete mode 100644 usr/share/ddtools/docs/ddtools.spec delete mode 100644 usr/share/ddtools/docs/files-for-versioning.txt delete mode 100755 usr/share/ddtools/inc/get-files delete mode 100755 usr/share/ddtools/inc/pack create mode 100644 usr/share/doc/ddtools/README.txt create mode 100644 usr/share/doc/ddtools/version.txt (limited to 'usr') diff --git a/usr/share/ddtools/build/ddtools.spec b/usr/share/ddtools/build/ddtools.spec new file mode 100644 index 0000000..b4aa82f --- /dev/null +++ b/usr/share/ddtools/build/ddtools.spec @@ -0,0 +1,62 @@ +# ref: http://www.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html +Summary: suite of scripts for managing dns and dhcpd +Name: ddtools +Version: 0.0 +Release: 3 +License: CC BY-SA 4.0 +Group: Applications/System +Source: ddtools.tgz +URL: https://bgstack15.wordpress.com/ +#Distribution: +#Vendor: +Packager: B Stack +Requires: bgscripts-core >= 1.2-11 +Obsoletes: updatezone <= %{version}-%{release} +Buildarch: noarch + +%description +ddtools provides shell scripts that help manage dns and dhcpd. +updatezone.sh takes a simple config file for selecting the dns zone files to edit. Bind is the only supported dns server right now, but experimentation is encouraged. +dhcpd-control helps manage paired dhcpd servers. + +#%global _python_bytecompile_errors_terminate_build 0 + +%prep +%setup + +%build + +%install +rm -rf %{buildroot} +rsync -a . %{buildroot}/ --exclude='**/.*.swp' --exclude='**/.git' + +%post +exit 0 + +%preun +exit 0 + +%postun +exit 0 + +%files +%dir /etc/ddtools +%dir /usr/share/ddtools +/etc/sysconfig/dhcpd-control +/usr/share/ddtools/inc/get-files +/usr/share/ddtools/inc/pack +%config %attr(666, -, -) /usr/share/ddtools/examples/ipa.smith122.com.conf.example +%doc %attr(444, -, -) /usr/share/ddtools/docs/files-for-versioning.txt +%doc %attr(444, -, -) /usr/share/ddtools/docs/README.txt +/usr/share/ddtools/docs/ddtools.spec +/usr/share/ddtools/updatezone.sh +/usr/share/ddtools/dhcpd-control.sh +%verify(link) /usr/bin/updatezone +%verify(link) /usr/bin/dhcpd-control + +%changelog +* Sat Oct 14 2017 B Stack 0.0-3 +- Updated content. See doc/README.txt + +* Sat May 27 2017 B Stack 0.0-1 +- Initial rpm release diff --git a/usr/share/ddtools/build/files-for-versioning.txt b/usr/share/ddtools/build/files-for-versioning.txt new file mode 100644 index 0000000..00edf00 --- /dev/null +++ b/usr/share/ddtools/build/files-for-versioning.txt @@ -0,0 +1,3 @@ +doc/README.txt +doc/version.txt +build/ddtools.spec diff --git a/usr/share/ddtools/build/get-files b/usr/share/ddtools/build/get-files new file mode 100755 index 0000000..3302cc5 --- /dev/null +++ b/usr/share/ddtools/build/get-files @@ -0,0 +1,40 @@ +#!/bin/sh +# File: get-files +case "${1}" in + rpm) +if test -n "${package}"; then cd ${rpmbuilddir}/SOURCES/"${package}-${version}"; else cd $( pwd | sed -r -e 's/(SOURCES\/[^\/]+\/).*/\1/;' ); fi + +### for rpm +find * -type d -regextype grep \ + \( -regex 'usr\/share\/ddtools*' -o -regex 'etc\/ddtools*' \) \ + ! -regex '.*gui.*' \ + | sed -e 's/^/%dir \//;' +find * -mindepth 1 ! -name "${package}.spec.$$.swp" \ + ! -type d -regextype grep \ + ! -regex '.*.swp' \ + ! -regex '.*DEBIAN.*' \ + | sed -r -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/; +s/(\/usr)?\/lib\/systemd\/system\/(.*)/%{_unitdir}\/\2/; +' + + ;; + deb) + +### for deb +find . -mindepth 1 ! -name "${package}.spec\.$$\.swp" \ + ! -type d -regextype grep \ + ! -regex '.*hg.*' ! -regex '.*?debian-binary.*' \ + ! -regex '.*DEBIAN.*' ! -regex '.*\.swp' ! -regex '.*\.git.*' ! -name 'README.md' \ + -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/ddtools/build/pack b/usr/share/ddtools/build/pack new file mode 100755 index 0000000..5173a22 --- /dev/null +++ b/usr/share/ddtools/build/pack @@ -0,0 +1,116 @@ +#!/bin/bash + +# DETERMINE LOCATION OF FRAMEWORK +while read flocation; do if test -x ${flocation} && test "$( ${flocation} --fcheck )" -ge 20170111; then frameworkscript="${flocation}"; break; fi; done <&2 && exit 4 + +. ${frameworkscript} || echo "$0: framework did not run properly. Continuing..." 1>&2 + +type=""; + +case "${thisflavor}" in + redhat|rhel|centos|fedora|korora) type=rpm;; + debian|ubuntu) type=dpkg;; + *) type=targz;; +esac + +echo " $@ " | grep -qiE -- "help|usage|\s-h\s|\s-\?" 1>/dev/null 2>&1 && { + # display help and exit + less -F </dev/null 2>&1 && type=rpm +echo " $@ " | grep -qiE -- "debian|ubuntu|deb\s|dpkg" 1>/dev/null 2>&1 && type=dpkg +echo " $@ " | grep -qiE -- "tar|tgz|gz" 1>/dev/null 2>&1 && type=targz +echo " $@ " | grep -qiE -- "scrub" 1>/dev/null 2>&1 && type=scrub + +# Display information +echo "packaging ${package}-${version} as ${type}" +echo " $@ " | grep -qiE -- "debug|\s-d[ 0-9]{0,3}\s" 1>/dev/null 2>&1 && exit 0 + +case "${type}" in + rpm) + +########## PACKAGING for rhel/centos +# if you copy-paste this, be sure to define package, version, shortversion +rpmbuilddir=~/rpmbuild/ +packagespecfile="${package}-${version}/usr/share/${package}/docs/${package}.spec" +sed -n -e '1,/^\%files$/p;' "${rpmbuilddir}/SOURCES/${packagespecfile}" > "${rpmbuilddir}/SOURCES/${packagespecfile}.$$.swp" # removes files and changelog +cd ${rpmbuilddir}/SOURCES/"${package}-${version}" +"${rpmbuilddir}/SOURCES/${package}-${version}/usr/share/${package}/inc/get-files" rpm >> "${rpmbuilddir}/SOURCES/${packagespecfile}.$$.swp" +{ printf '\n'; sed -n -e '/^\%changelog/,$p' "${rpmbuilddir}/SOURCES/${packagespecfile}"; } >> "${rpmbuilddir}/SOURCES/${packagespecfile}.$$.swp" +mv -f "${rpmbuilddir}/SOURCES/${packagespecfile}.$$.swp" "${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*' --exclude='README.md' -f "${package}.tgz" "${package}-${shortversion}" +cp -p "${rpmbuilddir}/SOURCES/${packagespecfile}" "${rpmbuilddir}/SPECS" +mkdir -p "${rpmbuilddir}/RPMS/noarch"; cd "${rpmbuilddir}/RPMS/noarch" +rpmbuild -bb "${rpmbuilddir}/SPECS/${package}.spec" +rm -rf "${rpmbuilddir}/SOURCES/${package}-${shortversion}/" "${rpmbuilddir}/SOURCES/${package}.tgz" + + ;; + dpkg) + +########## PACKAGING for ubuntu +# You need package dpkg-dev to build packages. +# if you copy-paste this, be sure to define package, version +debdir=~/deb +debiandirmain="${package}-${version}/usr/share/${package}/docs/debian-${package}" +cd "${debdir}/${package}-${version}" +"${debdir}/${package}-${version}/usr/share/${package}/inc/get-files" deb | xargs md5sum > "${debdir}/${debiandirmain}/md5sums" +#mkdir -p "${debdir}/$$"; mv "${debdir}/${package}-${version}/.git" "${debdir}/${package}-${version}/README.md" "${debdir}/$$/" +cd "${debdir}" + +# main +rm -rf "${debdir}/${package}-${version}/DEBIAN/" 2>/dev/null; mkdir -p "${debdir}/${package}-${version}/DEBIAN/" +cp -pf "${debdir}/${debiandirmain}"/* "${debdir}/${package}-${version}/DEBIAN/" +mkdir "${debdir}/${package}" 2>/dev/null; rm -rf "${debdir}/${package}-${version}-work.tgz" +tar -zc --exclude='.git*' --exclude='README.md' -f "${debdir}/${package}-${version}-work.tgz" -C "${debdir}/${package}-${version}" $( awk '{print $2}' "${debdir}/${package}-${version}/DEBIAN/md5sums" ) DEBIAN +tar -zx -C "${debdir}/${package}" -f "${debdir}/${package}-${version}-work.tgz" +fakeroot dpkg-deb -b "${debdir}/${package}" +mv -f "${debdir}/${package}.deb" "${debdir}/${package}-${version}.deb" +rm -rf "${debdir}/${package}-${version}-work.tgz" "${debdir}/${package}" + +#mv "${debdir}/$$/.git" "${debdir}/$$/"* "${debdir}/${package}-${version}/"; rmdir "${debdir}/$$" + + ;; + targz) + +########## PACKAGING in a master.tgz +# if you copy-paste this, be sure to define package, version +cd ~/deb 2>/dev/null || cd ~/rpmbuild/SOURCES +rm -rf ./"${package}-${version}".master.tgz +tar -zcf "${package}-${version}".master.tgz "${package}-${version}"/ + + ;; + scrub) + +########## SCRUB for publication +# if you copy-paste this, be sure to define package, version +cd ~/deb 2>/dev/null || cd ~/rpmbuild/SOURCES +cd "$( find . -name "*scrub.txt" | grep -iE "${package}-${version}\/" | xargs dirname )" +/usr/share/bgscripts/scrub.py + + ;; + unknown) + echo "error: check $0 for errors on type ${type}." 1>&2 + ;; +esac diff --git a/usr/share/ddtools/doc b/usr/share/ddtools/doc new file mode 120000 index 0000000..6aac6fe --- /dev/null +++ b/usr/share/ddtools/doc @@ -0,0 +1 @@ +../doc/ddtools \ No newline at end of file diff --git a/usr/share/ddtools/docs/README.txt b/usr/share/ddtools/docs/README.txt deleted file mode 100644 index db65caf..0000000 --- a/usr/share/ddtools/docs/README.txt +++ /dev/null @@ -1,48 +0,0 @@ -File: usr/share/ddtools/docs/README.txt -Package: ddtools -Author: bgstack15 -Startdate: 2017-05-26 -Title: Readme file for ddtools -Purpose: All packages should come with a readme -Usage: Read it. -Reference: README.txt -Improve: -Document: Below this line - -### WELCOME -ddtools is a suite of shell scripts that help manage dns and dhcpd. -Updatezone provides an easy way to update dns zone files. Intended primarily for bind9 zone files, experimentation is encouraged. -Instead of running the series of commands manually: rndc freeze, vi zonefile, rndc thaw and so on, use updatezone. -dhcpd-control helps manage paired dhcpd servers. - -### CONFIGURATION -The conf files belong in /etc/ddtools/. See example in /usr/share/ddtools/examples/. - -### USING THIS TOOL - -$ updatezone ipa.smith122.com -Where this file exists: /etc/ddtools/ipa.smith122.com.conf - - UZ_ZONE_NAME=ipa.smith122.com - UZ_FORWARD_ZONE=ipa.smith122.com - UZ_FORWARD_FILE=/var/named/data/db.ipa.smith122.com - UZ_REVERSE_ZONE=1.168.192.in-addr.arpa - UZ_REVERSE_FILE=/var/named/data/db.192.168.1 - UZ_SLAVE_COUNT=1 - UZ_SLAVE_1=dns2 - -The updatezone tool searches for the value of UZ_ZONE_NAME to declare a match and use that configuration file. -The zone definitions are used in the freeze/thaw/retransfer commands. - -This tool will only request updates for zones that are updated. Also, you do not need to adjust the serial number at all. The script will detect changes and then increment the serial number for you. - -You can also specify multiple zones on the command line. -$ updatezone ipa.smith122.com ad.smith122.com - -### NOTES - -### REFERENCE - -### CHANGELOG -2017-05-27 B Stack 0.0-2 -- Initial package construction diff --git a/usr/share/ddtools/docs/ddtools.spec b/usr/share/ddtools/docs/ddtools.spec deleted file mode 100644 index 9697112..0000000 --- a/usr/share/ddtools/docs/ddtools.spec +++ /dev/null @@ -1,59 +0,0 @@ -# ref: http://www.rpm.org/max-rpm/s1-rpm-build-creating-spec-file.html -Summary: suite of scripts for managing dns and dhcpd -Name: ddtools -Version: 0.0 -Release: 2 -License: CC BY-SA 4.0 -Group: Applications/System -Source: ddtools.tgz -URL: https://bgstack15.wordpress.com/ -#Distribution: -#Vendor: -Packager: B Stack -Requires: bgscripts-core >= 1.2-11 -Obsoletes: updatezone <= %{version}-%{release} -Buildarch: noarch - -%description -ddtools provides shell scripts that help manage dns and dhcpd. -updatezone.sh takes a simple config file for selecting the dns zone files to edit. Bind is the only supported dns server right now, but experimentation is encouraged. -dhcpd-control helps manage paired dhcpd servers. - -#%global _python_bytecompile_errors_terminate_build 0 - -%prep -%setup - -%build - -%install -rm -rf %{buildroot} -rsync -a . %{buildroot}/ --exclude='**/.*.swp' --exclude='**/.git' - -%post -exit 0 - -%preun -exit 0 - -%postun -exit 0 - -%files -%dir /etc/ddtools -%dir /usr/share/ddtools -/etc/sysconfig/dhcpd-control -/usr/share/ddtools/inc/get-files -/usr/share/ddtools/inc/pack -%config %attr(666, -, -) /usr/share/ddtools/examples/ipa.smith122.com.conf.example -%doc %attr(444, -, -) /usr/share/ddtools/docs/files-for-versioning.txt -%doc %attr(444, -, -) /usr/share/ddtools/docs/README.txt -/usr/share/ddtools/docs/ddtools.spec -/usr/share/ddtools/updatezone.sh -/usr/share/ddtools/dhcpd-control.sh -%verify(link) /usr/bin/updatezone -%verify(link) /usr/bin/dhcpd-control - -%changelog -* Sat May 27 2017 B Stack 0.0-1 -- Initial rpm release diff --git a/usr/share/ddtools/docs/files-for-versioning.txt b/usr/share/ddtools/docs/files-for-versioning.txt deleted file mode 100644 index f160609..0000000 --- a/usr/share/ddtools/docs/files-for-versioning.txt +++ /dev/null @@ -1,3 +0,0 @@ -docs/README.txt -docs/ddtools.spec -docs/debian-ddtools/control diff --git a/usr/share/ddtools/inc/get-files b/usr/share/ddtools/inc/get-files deleted file mode 100755 index 3302cc5..0000000 --- a/usr/share/ddtools/inc/get-files +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# File: get-files -case "${1}" in - rpm) -if test -n "${package}"; then cd ${rpmbuilddir}/SOURCES/"${package}-${version}"; else cd $( pwd | sed -r -e 's/(SOURCES\/[^\/]+\/).*/\1/;' ); fi - -### for rpm -find * -type d -regextype grep \ - \( -regex 'usr\/share\/ddtools*' -o -regex 'etc\/ddtools*' \) \ - ! -regex '.*gui.*' \ - | sed -e 's/^/%dir \//;' -find * -mindepth 1 ! -name "${package}.spec.$$.swp" \ - ! -type d -regextype grep \ - ! -regex '.*.swp' \ - ! -regex '.*DEBIAN.*' \ - | sed -r -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/; -s/(\/usr)?\/lib\/systemd\/system\/(.*)/%{_unitdir}\/\2/; -' - - ;; - deb) - -### for deb -find . -mindepth 1 ! -name "${package}.spec\.$$\.swp" \ - ! -type d -regextype grep \ - ! -regex '.*hg.*' ! -regex '.*?debian-binary.*' \ - ! -regex '.*DEBIAN.*' ! -regex '.*\.swp' ! -regex '.*\.git.*' ! -name 'README.md' \ - -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/ddtools/inc/pack b/usr/share/ddtools/inc/pack deleted file mode 100755 index 5173a22..0000000 --- a/usr/share/ddtools/inc/pack +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -# DETERMINE LOCATION OF FRAMEWORK -while read flocation; do if test -x ${flocation} && test "$( ${flocation} --fcheck )" -ge 20170111; then frameworkscript="${flocation}"; break; fi; done <&2 && exit 4 - -. ${frameworkscript} || echo "$0: framework did not run properly. Continuing..." 1>&2 - -type=""; - -case "${thisflavor}" in - redhat|rhel|centos|fedora|korora) type=rpm;; - debian|ubuntu) type=dpkg;; - *) type=targz;; -esac - -echo " $@ " | grep -qiE -- "help|usage|\s-h\s|\s-\?" 1>/dev/null 2>&1 && { - # display help and exit - less -F </dev/null 2>&1 && type=rpm -echo " $@ " | grep -qiE -- "debian|ubuntu|deb\s|dpkg" 1>/dev/null 2>&1 && type=dpkg -echo " $@ " | grep -qiE -- "tar|tgz|gz" 1>/dev/null 2>&1 && type=targz -echo " $@ " | grep -qiE -- "scrub" 1>/dev/null 2>&1 && type=scrub - -# Display information -echo "packaging ${package}-${version} as ${type}" -echo " $@ " | grep -qiE -- "debug|\s-d[ 0-9]{0,3}\s" 1>/dev/null 2>&1 && exit 0 - -case "${type}" in - rpm) - -########## PACKAGING for rhel/centos -# if you copy-paste this, be sure to define package, version, shortversion -rpmbuilddir=~/rpmbuild/ -packagespecfile="${package}-${version}/usr/share/${package}/docs/${package}.spec" -sed -n -e '1,/^\%files$/p;' "${rpmbuilddir}/SOURCES/${packagespecfile}" > "${rpmbuilddir}/SOURCES/${packagespecfile}.$$.swp" # removes files and changelog -cd ${rpmbuilddir}/SOURCES/"${package}-${version}" -"${rpmbuilddir}/SOURCES/${package}-${version}/usr/share/${package}/inc/get-files" rpm >> "${rpmbuilddir}/SOURCES/${packagespecfile}.$$.swp" -{ printf '\n'; sed -n -e '/^\%changelog/,$p' "${rpmbuilddir}/SOURCES/${packagespecfile}"; } >> "${rpmbuilddir}/SOURCES/${packagespecfile}.$$.swp" -mv -f "${rpmbuilddir}/SOURCES/${packagespecfile}.$$.swp" "${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*' --exclude='README.md' -f "${package}.tgz" "${package}-${shortversion}" -cp -p "${rpmbuilddir}/SOURCES/${packagespecfile}" "${rpmbuilddir}/SPECS" -mkdir -p "${rpmbuilddir}/RPMS/noarch"; cd "${rpmbuilddir}/RPMS/noarch" -rpmbuild -bb "${rpmbuilddir}/SPECS/${package}.spec" -rm -rf "${rpmbuilddir}/SOURCES/${package}-${shortversion}/" "${rpmbuilddir}/SOURCES/${package}.tgz" - - ;; - dpkg) - -########## PACKAGING for ubuntu -# You need package dpkg-dev to build packages. -# if you copy-paste this, be sure to define package, version -debdir=~/deb -debiandirmain="${package}-${version}/usr/share/${package}/docs/debian-${package}" -cd "${debdir}/${package}-${version}" -"${debdir}/${package}-${version}/usr/share/${package}/inc/get-files" deb | xargs md5sum > "${debdir}/${debiandirmain}/md5sums" -#mkdir -p "${debdir}/$$"; mv "${debdir}/${package}-${version}/.git" "${debdir}/${package}-${version}/README.md" "${debdir}/$$/" -cd "${debdir}" - -# main -rm -rf "${debdir}/${package}-${version}/DEBIAN/" 2>/dev/null; mkdir -p "${debdir}/${package}-${version}/DEBIAN/" -cp -pf "${debdir}/${debiandirmain}"/* "${debdir}/${package}-${version}/DEBIAN/" -mkdir "${debdir}/${package}" 2>/dev/null; rm -rf "${debdir}/${package}-${version}-work.tgz" -tar -zc --exclude='.git*' --exclude='README.md' -f "${debdir}/${package}-${version}-work.tgz" -C "${debdir}/${package}-${version}" $( awk '{print $2}' "${debdir}/${package}-${version}/DEBIAN/md5sums" ) DEBIAN -tar -zx -C "${debdir}/${package}" -f "${debdir}/${package}-${version}-work.tgz" -fakeroot dpkg-deb -b "${debdir}/${package}" -mv -f "${debdir}/${package}.deb" "${debdir}/${package}-${version}.deb" -rm -rf "${debdir}/${package}-${version}-work.tgz" "${debdir}/${package}" - -#mv "${debdir}/$$/.git" "${debdir}/$$/"* "${debdir}/${package}-${version}/"; rmdir "${debdir}/$$" - - ;; - targz) - -########## PACKAGING in a master.tgz -# if you copy-paste this, be sure to define package, version -cd ~/deb 2>/dev/null || cd ~/rpmbuild/SOURCES -rm -rf ./"${package}-${version}".master.tgz -tar -zcf "${package}-${version}".master.tgz "${package}-${version}"/ - - ;; - scrub) - -########## SCRUB for publication -# if you copy-paste this, be sure to define package, version -cd ~/deb 2>/dev/null || cd ~/rpmbuild/SOURCES -cd "$( find . -name "*scrub.txt" | grep -iE "${package}-${version}\/" | xargs dirname )" -/usr/share/bgscripts/scrub.py - - ;; - unknown) - echo "error: check $0 for errors on type ${type}." 1>&2 - ;; -esac diff --git a/usr/share/doc/ddtools/README.txt b/usr/share/doc/ddtools/README.txt new file mode 100644 index 0000000..2dcb55c --- /dev/null +++ b/usr/share/doc/ddtools/README.txt @@ -0,0 +1,51 @@ +File: usr/share/ddtools/docs/README.txt +Package: ddtools +Author: bgstack15 +Startdate: 2017-05-26 +Title: Readme file for ddtools +Purpose: All packages should come with a readme +Usage: Read it. +Reference: README.txt +Improve: +Document: Below this line + +### WELCOME +ddtools is a suite of shell scripts that help manage dns and dhcpd. +Updatezone provides an easy way to update dns zone files. Intended primarily for bind9 zone files, experimentation is encouraged. +Instead of running the series of commands manually: rndc freeze, vi zonefile, rndc thaw and so on, use updatezone. +dhcpd-control helps manage paired dhcpd servers. + +### CONFIGURATION +The conf files belong in /etc/ddtools/. See example in /usr/share/ddtools/examples/. + +### USING THIS TOOL + +$ updatezone ipa.smith122.com +Where this file exists: /etc/ddtools/ipa.smith122.com.conf + + UZ_ZONE_NAME=ipa.smith122.com + UZ_FORWARD_ZONE=ipa.smith122.com + UZ_FORWARD_FILE=/var/named/data/db.ipa.smith122.com + UZ_REVERSE_ZONE=1.168.192.in-addr.arpa + UZ_REVERSE_FILE=/var/named/data/db.192.168.1 + UZ_SLAVE_COUNT=1 + UZ_SLAVE_1=dns2 + +The updatezone tool searches for the value of UZ_ZONE_NAME to declare a match and use that configuration file. +The zone definitions are used in the freeze/thaw/retransfer commands. + +This tool will only request updates for zones that are updated. Also, you do not need to adjust the serial number at all. The script will detect changes and then increment the serial number for you. + +You can also specify multiple zones on the command line. +$ updatezone ipa.smith122.com ad.smith122.com + +### NOTES + +### REFERENCE + +### CHANGELOG +2017-05-27 B Stack 0.0-2 +- Initial package construction + +2017-10-14 B Stack 0.0-3 +- Rearranged directory structure to match current standards diff --git a/usr/share/doc/ddtools/version.txt b/usr/share/doc/ddtools/version.txt new file mode 100644 index 0000000..eb8d937 --- /dev/null +++ b/usr/share/doc/ddtools/version.txt @@ -0,0 +1 @@ +0.0-3 -- cgit