Commits

Anonymous committed 502ecbc

Add supervisor support

  • Participants
  • Parent commits e086c2b

Comments (0)

Files changed (3)

net-misc/nsq/Manifest

 AUX fix-nsqadmin-templates.patch 815 SHA256 65d2df27243677d4a25f383fb9ebaaef29fbf0179c3b0f2df410b73d1dad04b8 SHA512 0e1bbbc944b1512baffaea3f486124cf11aec62553f9930d0953246dfb55d5b90215606f77b64dad2117e0a15288e7db3643d3d7decbbbce2b01e408e76c729d WHIRLPOOL a586ca361d35b254bd2236fe8af63a9fb415c5cfc3eabcd9ca1c7e3b8f20ad1be4f772388208a1c578169daee03749fc7aa51da8a0fe2d96de35459d8026f19b
-EBUILD nsq-0.2.15.ebuild 1367 SHA256 2048a8f834345e117f08da861b8bd03eb279d31b90e7df6407e03f1357525f7f SHA512 a0e35b9961751d57f9dae4bc6526240b6307afb543a9c535b301e70410dbf2441cbdff385fdc2e891cdd27ee71bafd59da327dbce4e7a28e2ae309f89dcc342d WHIRLPOOL 4249dc1b0e44db0f9246f30112e6eeb307b97bcdb21968951e740ca879cb470e09c608b4a1d47f0264996c60f8a31c7aeec907a19adcff42cb662c3344a9f9e6
+AUX nsq.conf 872 SHA256 e08738afc7a55c76198f85d359f8828c236d4c2c36a4d9b9a0f42c5f1fcc24c9 SHA512 344a2b583d8ca03aa6f2a7aa4a57221bf97460e8bb4cd7b0f5a8ccd0e1ab0e67f98e5b1d339da94c51da2b43c222ab9248d77ec08f55aba547af8672946da350 WHIRLPOOL f2eacc6200dd1c6d1de7f7b9652caace9657d52317ede393ce8f8905bb8fdc0cd029aad6ef56e69311f706a59116ee33ffb3b92c95f3de0fd79a096591d6f841
+EBUILD nsq-0.2.15-r1.ebuild 1367 SHA256 2048a8f834345e117f08da861b8bd03eb279d31b90e7df6407e03f1357525f7f SHA512 a0e35b9961751d57f9dae4bc6526240b6307afb543a9c535b301e70410dbf2441cbdff385fdc2e891cdd27ee71bafd59da327dbce4e7a28e2ae309f89dcc342d WHIRLPOOL 4249dc1b0e44db0f9246f30112e6eeb307b97bcdb21968951e740ca879cb470e09c608b4a1d47f0264996c60f8a31c7aeec907a19adcff42cb662c3344a9f9e6
+EBUILD nsq-0.2.15-r2.ebuild 1608 SHA256 71fc1b71bfbb93115dd0efc9b236fff465716a8a8a137eb203b24d2e4ba21252 SHA512 dfac3976bcf33eaf2138d118af42d7ebc0ab9e16567a3226582acd4b6c3274f79cdf427eb957736549ed667ca4f51750ccfa59ea4cec5343d471763ea377b7ed WHIRLPOOL c7643b6c9962760c37b103dbbc447fb9a96c2795979191e05f15c1cc64c5f5f7d640bf9093dcafb0764f0d61c257e4e26b390bd51aa6597df67d0257e88b5504

net-misc/nsq/nsq-0.2.15-r1.ebuild

+ 
+#SRC_URI="http://github.com/bitly/nsq/archive/v${PV}.zip"
+EGIT_REPO_URI="https://github.com/bitly/nsq.git"
+IUSE="python"
+SLOT='0' 
+KEYWORDS="~amd64"
+DEPEND="dev-lang/go
+	"
+# include functions from eutils 
+inherit eutils
+
+pkg_setup() {
+	if [ ! -f /usr/lib/go/src/pkg/github.com/bitly/go-notify/notify.go ]; then
+		die "You need go-notify. Install it with 'go get github.com/bitly/go-notify' "
+	elif [ ! -f /usr/lib/go/src/pkg/github.com/bitly/go-simplejson/simplejson.go ]; then
+		die "You need go-simplejson. Install it with 'go get github.com/bitly/go-simplejson' "
+	elif [ ! -f /usr/lib/go/src/pkg/github.com/bmizerany/assert/assert.go ]; then
+		die "You need assert. Install it with 'go get github.com/bmizerany/assert' "
+	fi
+	#Create nsq user and group
+        enewgroup nsq
+        enewuser nsq -1 -1 /var/lib/nsq nsq
+
+}
+
+src_unpack() {
+    git clone https://github.com/bitly/nsq.git ${A} || die "Failed to get source"
+    cd nsq
+    git checkout v${PV}
+    sed -i 's/PREFIX=\/usr\/local/PREFIX=\/usr/g' Makefile
+    epatch "${FILESDIR}"/*.patch
+}
+
+src_compile() {
+	cd "${PN}"
+	emake || die "Compile failed"
+}
+
+src_install() {
+	cd "${PN}"
+	emake DESTDIR="${D}" install || die "Install failed"
+	diropts -m 0770 -o nsq -g nsq
+        keepdir /var/log/nsq
+	return	
+}
+
+
+pkg_postinst() {
+	go get github.com/bitly/nsq/nsq || die "Failed to get nsq package for GO"
+}

net-misc/nsq/nsq-0.2.15-r2.ebuild

+ 
+#SRC_URI="http://github.com/bitly/nsq/archive/v${PV}.zip"
+EGIT_REPO_URI="https://github.com/bitly/nsq.git"
+IUSE="python supervisor"
+SLOT='0' 
+KEYWORDS="~amd64"
+DEPEND="dev-lang/go
+	python? ( dev-lang/python )
+	supervisor? ( app-admin/supervisor )
+	"
+# include functions from eutils 
+inherit eutils
+
+pkg_setup() {
+	if [ ! -f /usr/lib/go/src/pkg/github.com/bitly/go-notify/notify.go ]; then
+		die "You need go-notify. Install it with 'go get github.com/bitly/go-notify' "
+	elif [ ! -f /usr/lib/go/src/pkg/github.com/bitly/go-simplejson/simplejson.go ]; then
+		die "You need go-simplejson. Install it with 'go get github.com/bitly/go-simplejson' "
+	elif [ ! -f /usr/lib/go/src/pkg/github.com/bmizerany/assert/assert.go ]; then
+		die "You need assert. Install it with 'go get github.com/bmizerany/assert' "
+	fi
+	#Create nsq user and group
+        enewgroup nsq
+        enewuser nsq -1 -1 /var/lib/nsq nsq
+
+}
+
+src_unpack() {
+    git clone https://github.com/bitly/nsq.git ${A} || die "Failed to get source"
+    cd nsq
+    git checkout v${PV}
+    sed -i 's/PREFIX=\/usr\/local/PREFIX=\/usr/g' Makefile
+    epatch "${FILESDIR}"/*.patch
+}
+
+src_compile() {
+	cd "${PN}"
+	emake || die "Compile failed"
+}
+
+src_install() {
+	cd "${PN}"
+	emake DESTDIR="${D}" install || die "Install failed"
+	diropts -m 0770 -o nsq -g nsq
+        keepdir /var/log/nsq
+	
+	if use supervisor; then
+		diropts -o root -g root
+		keepdir /etc/supervisor.d
+		insinto /etc/supervisor.d/   
+                doins "${FILESDIR}"/nsq.conf 
+	fi
+	return	
+}
+
+
+pkg_postinst() {
+	go get github.com/bitly/nsq/nsq || die "Failed to get nsq package for GO"
+}