Skip to content

Commit

Permalink
Merge pull request #7 from OSC/session
Browse files Browse the repository at this point in the history
Make patch for session opt-in
  • Loading branch information
treydock authored Jul 28, 2020
2 parents 4b8b84e + 4069f38 commit fcf5d55
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions packaging/ondemand-dex.spec
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,37 @@ export PATH=$PATH:%{_buildrootdir}/go/bin
GOPATH=$(go env GOPATH)
%__mkdir_p $GOPATH/src/github.com/dexidp/dex
%__cp -R ./* $GOPATH/src/github.com/dexidp/dex/
cd $GOPATH/src/github.com/dexidp/dex/
%__patch -p1 < %{SOURCE3}

%build
export PATH=$PATH:%{_buildrootdir}/go/bin
GOPATH=$(go env GOPATH)
cd $GOPATH/src/github.com/dexidp/dex/
%__make bin/dex
%__mv bin/dex bin/dex-orig
%__patch -p1 < %{SOURCE3}
%__make bin/dex
%__mv bin/dex bin/dex-session
%__mv bin/dex-orig bin/dex


%install
export PATH=$PATH:%{_buildrootdir}/go/bin
GOPATH=$(go env GOPATH)
cd $GOPATH/src/github.com/dexidp/dex/
%__install -p -m 755 -D bin/dex %{buildroot}%{_sbindir}/%{name}
%__install -p -m 755 -D bin/dex-session %{buildroot}%{_sbindir}/%{name}-session
%__install -p -m 600 -D examples/config-dev.yaml %{buildroot}%{confdir}/config.yaml
touch %{buildroot}%{confdir}/dex.db
%__mkdir_p %{buildroot}%{_datadir}/%{name}
%__cp -R web %{buildroot}%{_datadir}/%{name}/web
%__mkdir_p %{buildroot}%{_datadir}/%{name}/web/themes/ondemand
%__tar -C %{buildroot}%{_datadir}/%{name}/web/themes/ondemand -xzf %{SOURCE2}
%__mkdir_p %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d
%__cat >> %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d/session.conf.example << EOF
[Service]
ExecStart=
ExecStart=%{_sbindir}/%{name}-session serve %{confdir}/config.yaml
EOF
%__mkdir_p %{buildroot}%{_unitdir}
%__cat >> %{buildroot}%{_unitdir}/%{name}.service << EOF
[Unit]
Expand All @@ -68,6 +78,7 @@ After=network-online.target multi-user.target
Wants=network-online.target
[Service]
SyslogIdentifier=%{name}
WorkingDirectory=%{_datadir}/%{name}
ExecStart=%{_sbindir}/%{name} serve %{confdir}/config.yaml
User=%{name}
Expand Down Expand Up @@ -95,9 +106,13 @@ getent passwd %{name} > /dev/null || useradd -r -d /var/lib/%{name} -g %{name} -

%files
%{_sbindir}/%{name}
%{_sbindir}/%{name}-session
%dir %attr(0700,%{name},%{name}) %{confdir}
%config(noreplace,missingok) %attr(0600,%{name},%{name}) %{confdir}/config.yaml
%ghost %{confdir}/dex.db
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*
%dir %{_sysconfdir}/systemd/system/%{name}.service.d
%ghost %{_sysconfdir}/systemd/system/%{name}.service.d/session.conf
%{_sysconfdir}/systemd/system/%{name}.service.d/session.conf.example
%{_unitdir}/%{name}.service

0 comments on commit fcf5d55

Please sign in to comment.