forked from breard-r/acmed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the account and certificate default directories
Those directories were located in /etc/acmed/, which is not the best choice. According to the Filesystem Hierarchy Standard, they should be located in /var/lib/acmed/. Because systems may have different conventions, those values are now configuration at build time. https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
- Loading branch information
Showing
7 changed files
with
108 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,40 @@ | ||
use std::env; | ||
use std::path::PathBuf; | ||
|
||
macro_rules! set_rustc_env_var { | ||
($name: expr, $value: expr) => {{ | ||
println!("cargo:rustc-env={}={}", $name, $value); | ||
}}; | ||
} | ||
|
||
macro_rules! set_env_var_if_absent { | ||
($name: expr, $default_value: expr) => {{ | ||
if let Err(_) = env::var($name) { | ||
set_rustc_env_var!($name, $default_value); | ||
} | ||
}}; | ||
} | ||
|
||
macro_rules! set_specific_path_if_absent { | ||
($env_name: expr, $env_default: expr, $name: expr, $default_value: expr) => {{ | ||
let prefix = env::var($env_name).unwrap_or(String::from($env_default)); | ||
let mut value = PathBuf::new(); | ||
value.push(prefix); | ||
value.push($default_value); | ||
set_env_var_if_absent!($name, value.to_str().unwrap()); | ||
}}; | ||
} | ||
|
||
macro_rules! set_runstate_path_if_absent { | ||
($name: expr, $default_value: expr) => {{ | ||
set_specific_path_if_absent!("RUNSTATEDIR", "/var/run", $name, $default_value); | ||
}}; | ||
} | ||
|
||
fn main() { | ||
if let Ok(target) = env::var("TARGET") { | ||
println!("cargo:rustc-env=TACD_TARGET={}", target); | ||
}; | ||
|
||
set_runstate_path_if_absent!("TACD_DEFAULT_PID_FILE", "tacd.pid"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters