# @package      hubzero-submit-condor
# @file         Makefile
# @copyright    Copyright (c) 2010-2020 The Regents of the University of California.
# @license      http://opensource.org/licenses/Apache-2.0 Apache2
#
# Copyright (c) 2010-2020 The Regents of the University of California.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# HUBzero is a registered trademark of The Regents of the University of California.
#

ETC=$(DESTDIR)/etc
VARCONDOR=$(DESTDIR)/var/condor

DISTRIBUTION := $(shell lsb_release --id --short)
MAJORVERSION := $(shell lsb_release -rs | cut -d"." -f 1)

all:
	@true

install:
	install --mode 0750 --directory $(VARCONDOR)/Condor/Install
	install --mode 0644 --target-directory $(VARCONDOR)/Condor/Install 00-security.conf
	install --mode 0644 --target-directory $(VARCONDOR)/Condor/Install 01-kernel-tuning.conf
	install --mode 0644 --target-directory $(VARCONDOR)/Condor/Install 83-mount-under.conf
	install --mode 0644 --target-directory $(VARCONDOR)/Condor/Install condor.service.in
	install --mode 0754 --target-directory $(VARCONDOR)/Condor/Install installHTCondor.sh
	install --mode 0644 Makefile.htcondor  $(VARCONDOR)/Condor/Install/Makefile

uninstall:

postrm:
	deluser  condor || true
	groupdel condor || true

postinst:
	(getent passwd condor > /dev/null 2>&1) || adduser --system --group --force-badname --home /var/condor \
                                                      --shell /bin/bash --disabled-password --gecos Condor condor

clean:

.PHONY: all install uninstall postinst clean
