Skip to content

Commit

Permalink
update specfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Feb 22, 2013
1 parent 8086627 commit 2555d09
Showing 1 changed file with 7 additions and 31 deletions.
38 changes: 7 additions & 31 deletions contrib/nsq.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%define name nsq
%define version 0.2.12
%define release 21
%define version 0.2.18
%define release 1
%define path usr/local
%define group Database/Applications
%define __os_install_post %{nil}
Expand All @@ -25,41 +25,17 @@ https://github.com/bitly/nsq
mkdir -p $RPM_BUILD_DIR/%{name}-%{version}-%{release}
cd $RPM_BUILD_DIR/%{name}-%{version}-%{release}
git clone git@github.com:bitly/nsq.git
# cd nsq
# git checkout %{commit}

%build
# source GOROOT, GOPATH, GOARCH, etc
# . /etc/profile.d/go.sh
cd $RPM_BUILD_DIR/%{name}-%{version}-%{release}/nsq/nsqd
go build
cd $RPM_BUILD_DIR/%{name}-%{version}-%{release}/nsq/nsqlookupd
go build
cd $RPM_BUILD_DIR/%{name}-%{version}-%{release}/nsq/nsqadmin
go build
cd $RPM_BUILD_DIR/%{name}-%{version}-%{release}/nsq/examples/nsq_to_file
go build
cd $RPM_BUILD_DIR/%{name}-%{version}-%{release}/nsq/examples/nsq_pubsub
go build
cd $RPM_BUILD_DIR/%{name}-%{version}-%{release}/nsq/examples/nsq_to_http
go build
cd $RPM_BUILD_DIR/%{name}-%{version}-%{release}/nsq
make PREFIX=/%{path}

%install
export DONT_STRIP=1
export gopath=$RPM_BUILD_DIR/%{name}-%{version}-%{release}
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{path}/bin
mkdir -p $RPM_BUILD_ROOT/%{path}/share/nsqadmin/templates
mkdir -p ${RPM_BUILD_ROOT}${GOPATH}
cp $gopath/nsq/nsqd/nsqd $RPM_BUILD_ROOT/%{path}/bin
cp $gopath/nsq/nsqlookupd/nsqlookupd $RPM_BUILD_ROOT/%{path}/bin
cp $gopath/nsq/nsqadmin/nsqadmin $RPM_BUILD_ROOT/%{path}/bin
cp $gopath/nsq/examples/nsq_to_file/nsq_to_file $RPM_BUILD_ROOT/%{path}/bin
cp $gopath/nsq/examples/nsq_pubsub/nsq_pubsub $RPM_BUILD_ROOT/%{path}/bin
cp $gopath/nsq/examples/nsq_to_http/nsq_to_http $RPM_BUILD_ROOT/%{path}/bin
cp -R $gopath/nsq/nsqadmin/templates $RPM_BUILD_ROOT/%{path}/share/nsqadmin
cp -R $gopath/src ${RPM_BUILD_ROOT}${GOPATH}
cp -R $gopath/pkg ${RPM_BUILD_ROOT}${GOPATH}
cd $RPM_BUILD_DIR/%{name}-%{version}-%{release}/nsq
# binaries and template data
make PREFIX=/${path} DESTDIR=$RPM_BUILD_ROOT install

%files
/%{path}/bin/nsqadmin
Expand Down

0 comments on commit 2555d09

Please sign in to comment.