Skip to content

Commit

Permalink
Updated PKGBUILD and install script
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Jun 12, 2023
1 parent 2351a49 commit 01b3faf
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 30 deletions.
13 changes: 5 additions & 8 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Maintainer: Ulises Jeremias Cornejo Fandos <[email protected]>
# Maintainer: Federico Ramon Gasquez <[email protected]>
# Maintainer: Maria Macarena Lindo Poisson <[email protected]>

pkgname=dots-stable
pkgver=1.0.0
pkgver=1.2.2
pkgrel=1
pkgdesc="Dotfiles generator that allows quick configuration and managing of different tools and window managers in multiple OSs"
arch=(any)
Expand All @@ -17,18 +15,17 @@ source=("git+$url.git")
md5sums=('SKIP')

pkgver() {
cd dotfiles || exit 1
git fetch --tags
cd dotfiles
git describe --tags "$(git rev-list --tags --max-count=1)" | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
cd dotfiles || exit 1
cd dotfiles
git fetch --tags
latest_release=$(git describe --tags "$(git rev-list --tags --max-count=1)")
git checkout "${latest_release}"
PKGNAME=dots
DESTDIR="${pkgdir}"
export DESTDIR PKGNAME
PKGDIR="${pkgdir}"
export PKGDIR PKGNAME
./install
}
13 changes: 5 additions & 8 deletions PKGBUILD.dev
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Maintainer: Ulises Jeremias Cornejo Fandos <[email protected]>
# Maintainer: Federico Ramon Gasquez <[email protected]>
# Maintainer: Maria Macarena Lindo Poisson <[email protected]>

pkgname=dots-git
pkgver=1.0.0.r11.ge8b9cfc
pkgver=1.2.2
pkgrel=1
pkgdesc="Dotfiles generator that allows quick configuration and managing of different tools and window managers in multiple OSs"
arch=(any)
Expand All @@ -17,15 +15,14 @@ source=("git+$url.git")
md5sums=('SKIP')

pkgver() {
cd dotfiles || exit 1
git fetch --tags
cd dotfiles
git describe --tags "$(git rev-list --tags --max-count=1)" | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
cd dotfiles || exit 1
cd dotfiles
PKGNAME=dots
DESTDIR="${pkgdir}"
export DESTDIR PKGNAME
PKGDIR="${pkgdir}"
export PKGDIR PKGNAME
./install
}
28 changes: 14 additions & 14 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ PKGNAME=${PKGNAME:-"dots"}
# creates variable `os`
. "${ROOT}"/util/os.sh

rm -rf "${DESTDIR}/opt/${PKGNAME}" \
"${DESTDIR}/usr/bin/dots" \
"${DESTDIR}/usr/share/licenses/${PKGNAME}/" \
"${DESTDIR}/usr/share/doc/${PKGNAME}/"
rm -rf "${PKGDIR}/opt/${PKGNAME}" \
"${PKGDIR}/usr/bin/dots" \
"${PKGDIR}/usr/share/licenses/${PKGNAME}/" \
"${PKGDIR}/usr/share/doc/${PKGNAME}/"

install -d "${DESTDIR}/opt/${PKGNAME}"
install -d "${PKGDIR}/opt/${PKGNAME}"

for dirname in common "${os}" ui util; do
cp -Rf "${ROOT}"/"${dirname}" "${DESTDIR}/opt/${PKGNAME}"
cp -Rf "${ROOT}"/"${dirname}" "${PKGDIR}/opt/${PKGNAME}"
done

install -Dm644 "${ROOT}"/LICENSE -t "${DESTDIR}/usr/share/licenses/${PKGNAME}/"
install -Dm644 "${ROOT}"/README.md -t "${DESTDIR}/usr/share/doc/${PKGNAME}/"
install -Dm755 "${ROOT}"/dots -t "${DESTDIR}/opt/${PKGNAME}/"
install -Dm644 "${ROOT}"/LICENSE -t "${PKGDIR}/usr/share/licenses/${PKGNAME}/"
install -Dm644 "${ROOT}"/README.md -t "${PKGDIR}/usr/share/doc/${PKGNAME}/"
install -Dm755 "${ROOT}"/dots -t "${PKGDIR}/opt/${PKGNAME}/"

mkdir -p "${DESTDIR}"/usr/bin
mkdir -p "${PKGDIR}"/usr/bin

# Create dots binary at ${DESTDIR}/usr/bin/${PKGNAME} to wrap the file at ${DESTDIR}/opt/${PKGNAME}/dots
cat > "${DESTDIR}"/usr/bin/"${PKGNAME}" <<EOF
# Create dots binary at ${PKGDIR}/usr/bin/${PKGNAME} to wrap the file at ${PKGDIR}/opt/${PKGNAME}/dots
cat > "${PKGDIR}"/usr/bin/"${PKGNAME}" <<EOF
#!/usr/bin/env sh
${DESTDIR}/opt/${PKGNAME}/dots "\$@"
${PKGDIR}/opt/${PKGNAME}/dots "\$@"
EOF

chmod +x "${DESTDIR}/usr/bin/${PKGNAME}"
chmod +x "${PKGDIR}/usr/bin/${PKGNAME}"

0 comments on commit 01b3faf

Please sign in to comment.