#!/bin/bash # Open PKGBUILD if it exists and exit [[ -e PKGBUILD ]] && ${EDITOR:-vim} PKGBUILD && exit ################################################################################ # path to the PKGBUILD.proto PROTO=/usr/share/pacman/PKGBUILD.proto PROTOINST=/usr/share/pacman/proto.install MAINTAINER="Samir Benmendil " ################################################################################ echo "No PKGBUILD was found." while true; do read -p "Do you wish to create one? [Y/n] " yn case $yn in [Yy]* ) break;; '' ) break;; [Nn]* ) exit;; * ) ;; esac done # get the package name # I will consider that the folder you're in is also the pkgname # if its not you can change it later PKGNAME=`basename $(pwd)` cp $PROTO PKGBUILD cp $PROTOINST $PKGNAME.install sed -i "1,5d" PKGBUILD sed -i "s/# Maintainer: .*/# Maintainer: ${MAINTAINER}\n/" PKGBUILD sed -i "s/pkgname=.*/pkgname=${PKGNAME}/" PKGBUILD $EDITOR PKGBUILD