summaryrefslogblamecommitdiff
path: root/eclass/flx-init-scripts.eclass
blob: 572e25153cfd27022196d6a5cfe6ac1fa3a3fa9f (plain) (tree)
1
2
3
4
5
6
7
8
9
                                       
                                                                  
 





                                          
 


                      
 


                                                                      


                       
       
 
                                        
 
                                


                                                 


                   


                                             
          



                                                       

            


                                                 

 
                                
                 

                            
                                  
 
                                             
 
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# @ECLASS: flx-init-scripts.eclass
# @MAINTAINER:
# Bertrand Jacquin <bertrand@jacquin.bzh>
# @BLURB: Eclass for Formilux init scripts
# @DESCRIPTION:
# Formilux init scripts helper

inherit git-r3

SVCNAME="${PN//init-}"

DESCRIPTION="Formilux init script for ${SVCNAME}"
HOMEPAGE="http://master.formilux.org/git/dist/pkg/${SVCNAME}.git"
EGIT_REPO_URI="http://master.formilux.org/git/dist/pkg/${SVCNAME}.git"

LICENSE="public-domain"
SLOT="0"
IUSE=""

EXPORT_FUNCTIONS src_prepare src_install

flx-init-scripts_src_prepare() {
	if [[ -d addons && ! -e add-ons ]] ; then
		mv addons add-ons
	fi

	local _f
	for _f in \
		add-ons/initscript \
		"add-ons/init.d/${SVCNAME}" \
		"add-ons/${SVCNAME}.init"
	do
		if [[ -e "${_f}" ]] ; then
			mv "${_f}" "add-ons/${SVCNAME}"
			break
		fi
	done

	if [[ ! -f "add-ons/${SVCNAME}" ]] ; then
		die "No init script found"
	fi
}

flx-init-scripts_src_install() {
	cd "${S}"

	exeinto /sbin/init.d
	doexe "add-ons/${SVCNAME}"

	[[ -e ChangeLog ]] && dodoc ChangeLog
}